Changeset 1349
- Timestamp:
- 02/28/07 01:08:08 (2 years ago)
- Files:
-
- feedmelinks/_config/.htaccess (modified) (1 diff)
- feedmelinks/account.php (modified) (17 diffs)
- feedmelinks/img/hose.png (added)
- feedmelinks/img/rss-sq.png (added)
- feedmelinks/login.php (modified) (14 diffs)
- feedmelinks/modules/utils.inc.php (modified) (3 diffs)
- feedmelinks/script/bulk-management.js (added)
- feedmelinks/style/main.css (modified) (1 diff)
- feedmelinks/style/validation.css (added)
- feedmelinks/validate (added)
- feedmelinks/validate/im.php (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
feedmelinks/_config/.htaccess
r920 r1349 1 1 Options -Indexes 2 <Limit GET POST PUT> 3 require user jm3 4 </Limit> 2 5 6 feedmelinks/account.php
r1334 r1349 1 < %1 <?php 2 2 # $Id$ 3 3 include_once( "modules/utils.inc.php" ); 4 4 $site = getSiteUrl(); 5 5 $max_profile_image_size = 500000; 6 %>6 ?> 7 7 <title> Feed Me Links : My Profile </title> 8 < % include( "$modules/header.inc.php" ); %>8 <?php include( "$modules/header.inc.php" ); ?> 9 9 <br /> 10 < %10 <?php 11 11 if( $tok && $tok == md5( getPasswdForUser( $u )) ) { 12 12 $con_account = mysql_connect(); 13 13 mysql_selectdb( getDBName() ); 14 14 15 if( $op == "update-email" ) { 15 if( $op == "update-im" ) { 16 if( !$im ) 17 return; 18 $im = urlencode( $im ); 19 $success = run_query( "UPDATE users SET im = '$im' WHERE userId = '$u'" ); 20 insert_message( "Updating your AIM name to $im..." . ($success ? "complete!" : "failed. :-(" )); 21 $showForm = 1; 22 } else if( $op == "update-email" ) { 16 23 if( $email ) { 17 24 $email = urlencode( $email ); … … 19 26 $successEmail = mysql_query( $qs ); 20 27 $showForm = 1; 21 %>28 ?> 22 29 <div class="attention"> 23 30 <div class="warning"> 24 Updating your email address to <u>< %= urldecode( $email ) %></u> ...25 < %31 Updating your email address to <u><?= urldecode( $email ) ?></u> ... 32 <?php 26 33 if( $successEmail ) 27 34 echo "DONE!"; … … 29 36 echo "failed."; 30 37 $showForm = 1; 31 %>38 ?> 32 39 </div> 33 40 </div> 34 < %41 <?php 35 42 } else { 36 43 $showForm = 1; … … 43 50 $qs = "UPDATE users SET password = '$password' WHERE userId = '$u'"; 44 51 $successPass = mysql_query( $qs ); 45 %>52 ?> 46 53 <div class="attention"> 47 54 <div class="warning"> 48 55 Updating your password... 49 < %56 <?php 50 57 # SLOPPY / WRONG: 51 58 if( $successPass ) … … 54 61 echo "failed."; 55 62 $showForm = 1; 56 %>63 ?> 57 64 </div> 58 65 </div> 59 < %66 <?php 60 67 } else { 61 68 warn( "Sorry, the password you typed doesn't match what we have on file." … … 88 95 # fix perms: 89 96 chmod( $uploadFile, 0666 ); 90 %>97 ?> 91 98 92 99 <div class="attention"> … … 95 102 <br /> 96 103 97 < %104 <?php 98 105 showUserImage( $u ); 99 %>106 ?> 100 107 <h2><a style="color: #ff6600;" href="/account">« Back to your profile.</a></h2> 101 108 or <h2><a style="color: #ff6600;" href="/">« Back to your links.</a></h2> 102 < %109 <?php 103 110 } else { 104 111 warn( "Owch, invalid file upload! Try a smaller image (less than 500k)." ); … … 133 140 } 134 141 conClose( $con_account ); 135 %>142 ?> 136 143 137 144 <script type="text/javascript"> … … 146 153 } else if( ! filter.test( e )) { 147 154 alert( "Please double-check your email address." ); 155 return false; 156 } else { 157 return true; 158 } 159 } 160 161 function check_im( f ) { 162 var e = f.im.value; 163 var filter = /^[a-zA-Z0-9_\.\-\@]+$/; 164 if( e == '' ) { 165 alert( "Please enter your AIM name." ); 166 return false; 167 } else if( ! filter.test( e )) { 168 alert( "Please double-check that your AIM name is correct." ); 148 169 return false; 149 170 } else { … … 176 197 </script> 177 198 178 <form method="post" action="/account" name="profile_email_form"179 onSubmit="return check_email(document.forms.profile_email_form);">180 <input type="hidden" name="op" value="update-email" />181 182 199 <div id="accountBox" style="width: 48em;"> 183 <div class="subhead"> 184 MY PROFILE: 185 </div> 186 <div class="r0" style="width: 47em; height: 34em;"> 200 <h1>MY PROFILE:</h1> 201 <div class="r0" style="width: 47em; height: 49em; margin-left: auto; margin-right: auto;"> 187 202 188 203 <div style="float: left;"> 189 204 190 205 <table border="0" width="450" cellspacing="0" cellpadding="7"> 206 207 <form method="post" action="/account" name="profile_email_form" 208 onSubmit="return check_email(document.forms.profile_email_form);"> 209 <input type="hidden" name="op" value="update-email" /> 191 210 <tr> 192 211 <td> … … 194 213 </td> 195 214 <td> 196 < %= getEmailAddressForUser( $u ) %>215 <big><big><?= getEmailAddressForUser( $u ) ?></big></big> 197 216 </td> 198 217 </tr> 199 218 <tr height="40" valign="top"> 200 219 <td align="right"> 201 NewEmail:220 Change Email: 202 221 </td> 203 222 <td> … … 205 224 <input type="submit" class="default button" value="Update" /> 206 225 <br /> 226 <br /> 227 <br /> 228 </td> 229 </tr> 230 </form> 231 <br /> 232 233 <form method="post" action="/account" name="profile_im_form" 234 onSubmit="return check_im(document.forms.profile_im_form);"> 235 <input type="hidden" name="op" value="update-im" /> 236 <tr> 237 <td> 238 <b>MY <abbr title="AOL Instant Messenger">A.I.M.</abbr> NAME:</b> 239 </td> 240 <td> 241 <big><big><?= get_IM_address_for_user( $u ) ?></big></big> 242 <span class="subtle"><?= IM_address_is_validated( $u ) ? "" : "(not validated)" ?></span> 243 </td> 244 </tr> 245 <tr height="40" valign="top"> 246 <td align="right"> 247 Change AIM name: 248 </td> 249 <td> 250 <input type="text" name="im" size="24" value="" /> 251 <input type="submit" class="default button" value="Update" /> 252 <br /> 253 (not displayed publicly) 207 254 <br /> 208 255 <br /> … … 222 269 <tr> 223 270 <td align="right"> 224 NewPassword:225 </td> 226 <td> 227 <input type="password" name="password1" size="24" value="< %= $password %>" />271 Change Password: 272 </td> 273 <td> 274 <input type="password" name="password1" size="24" value="<?= $password ?>" /> 228 275 </td> 229 276 </tr> … … 233 280 </td> 234 281 <td> 235 <input type="password" name="password2" size="24" value="< %= $password %>" />282 <input type="password" name="password2" size="24" value="<?= $password ?>" /> 236 283 <input type="submit" class="default button" value="Update" /> 237 284 <br /> … … 243 290 244 291 <form method="post" action="/account" enctype="multipart/form-data" name="profile_image_form"> 245 <input type="hidden" name="MAX_FILE_SIZE" value="< %= $max_profile_image_size %>" />292 <input type="hidden" name="MAX_FILE_SIZE" value="<?= $max_profile_image_size ?>" /> 246 293 <input type="hidden" name="op" value="update-profile-image" /> 247 294 <tr> 248 <td colspan="2">295 <td> 249 296 <b>MY PROFILE IMAGE:</b> 250 297 </td> 298 <td> 299 <img src="/<?= get_thumbnail_image( $u ) ?>" style="padding: 5px;" /> 300 </td> 301 251 302 </tr> 252 303 <tr> … … 277 328 278 329 <!-- div> 279 < % #include_once( "$modules/user-fields.inc.php" ); %>330 <?php #include_once( "$modules/user-fields.inc.php" ); ?> 280 331 </div --> 281 332 282 < %333 <?php 283 334 } 284 335 include( "$modules/footer.inc.php" ); … … 286 337 echo bounceTo( $site . "/login?bounceToPage=" . urlencode( "account" )); 287 338 } 288 %>339 ?> feedmelinks/login.php
r1269 r1349 1 < %1 <?php 2 2 # $Id$ 3 3 … … 47 47 touch_user( $dbUserId ); 48 48 49 %>50 <div class="welcome">Welcome, <b>< %= $userId %></b>!<br />49 ?> 50 <div class="welcome">Welcome, <b><?= $userId ?></b>!<br /> 51 51 <small> 52 52 <small> … … 58 58 </small> 59 59 </div> 60 < %60 <?php 61 61 $shouldShowLoginForm = 0; 62 62 $noFooter = true; … … 126 126 $shouldShowLoginForm = 0; 127 127 $shouldShowCreateForm = 0; 128 129 130 # function accepts: 131 # $argUserId, $argEmail, $argPassword, $argName, $argPostCode, $argIM, $argIMType, $argPostCode, $argIM, $argIMType 132 128 133 $userAdded = addUser( $userId, $email, $password, "" ); 129 134 if( $userAdded ) { … … 194 199 $mesg = "Dang. Login failed. Please double-check your username and password and try again, or email the <a href='mailto:" . get_spamsafe_email() . "'>admins</a> if you need help."; 195 200 } 196 %>197 198 < % include( "$modules/header.insecure.inc.php" ); %>199 200 < % if( $shouldShowLoginForm || $shouldShowCreateForm ) { %>201 ?> 202 203 <?php include( "$modules/header.insecure.inc.php" ); ?> 204 205 <?php if( $shouldShowLoginForm || $shouldShowCreateForm ) { ?> 201 206 <title> Feed me your password! </title> 202 207 </head> 203 208 <body onLoad="if( document.forms['login_form'] ) document.forms['login_form'].userId.focus();" > 204 209 <img src="img/login-logo.gif" /> 205 < % } %>206 207 < % if( $shouldShowLoginForm ) { %>208 < % include( "$modules/announce.inc.php" ); %>209 210 <br /> 211 <form name="login_form" action="< %= $page %>" method="POST">210 <?php } ?> 211 212 <?php if( $shouldShowLoginForm ) { ?> 213 <?php include( "$modules/announce.inc.php" ); ?> 214 215 <br /> 216 <form name="login_form" action="<?= $page ?>" method="POST"> 212 217 <input type="hidden" name="op" value="login" /> 213 <input type="hidden" name="debug" value="< %= $debug %>" />214 < % if( $bounceToPage ) { %>215 <input type="hidden" name="bounceToPage" value="< %= $bounceToPage %>" />216 < % } %>217 < % if( $name || $url ) { %>218 <input type="hidden" name="debug" value="<?= $debug ?>" /> 219 <? if( $bounceToPage ) { ?> 220 <input type="hidden" name="bounceToPage" value="<?= $bounceToPage ?>" /> 221 <?php } ?> 222 <?php if( $name || $url ) { ?> 218 223 <input type="hidden" name="passThroughURL" value="1" /> 219 <input type="hidden" name="name" value="< %= urlencode( $name ) %>" />224 <input type="hidden" name="name" value="<?= urlencode( $name ) ?>" /> 220 225 <input type="hidden" name="loggedIn" value="wasnt" /> 221 <input type="hidden" name="url" value="< %= urlencode( $url ) %>" />222 <input type="hidden" name="ref" value="< %= urlencode( $ref ) %>" />223 < % } %>224 < % if( $from ) { %>225 <input type="hidden" name="from" value="< %= urlencode( $from ) %>" />226 < % } %>226 <input type="hidden" name="url" value="<?= urlencode( $url ) ?>" /> 227 <input type="hidden" name="ref" value="<?= urlencode( $ref ) ?>" /> 228 <?php } ?> 229 <?php if( $from ) { ?> 230 <input type="hidden" name="from" value="<?= urlencode( $from ) ?>" /> 231 <?php } ?> 227 232 228 233 <div> 229 234 <div style="float: left; margin-right: 1em;"> 230 <% include_once( "$modules/mascot-image.inc.php" ); %>235 <?php include_once( "$modules/mascot-image.inc.php" ); ?> 231 236 </div> 232 237 <div style="float: right;"> 233 238 <table width="310" border="0"> 234 239 235 < % if( $mesg ) { %>240 <?php if( $mesg ) { ?> 236 241 237 242 <tr> 238 243 <td colspan="2"> 239 244 <div class="warning"> 240 <b>< %= $mesg %></b>245 <b><?= $mesg ?></b> 241 246 </div> 242 247 <br /> … … 244 249 </td> 245 250 </tr> 246 < % } %>251 <?php } ?> 247 252 248 253 <tr> 249 254 <td align="right"><b>Username</b>:</td> 250 <td><input name="userId" value="< %= $pass_user ? $pass_user : $userId %>" class="nfield" /></td>255 <td><input name="userId" value="<?= $pass_user ? $pass_user : $userId ?>" class="nfield" /></td> 251 256 </tr> 252 257 <tr> 253 258 <td align="right"><b>Password</b>:</td> 254 <td><input name="password" value="< %= $password %>" type="password" class="nfield" /></td>259 <td><input name="password" value="<?= $password ?>" type="password" class="nfield" /></td> 255 260 </tr> 256 261 <tr> … … 259 264 <input type="submit" class="button" value="Log In Now" /> 260 265 or 261 <input type="button" onClick="window.location='< %= $page %>?op=inputNewAccount';" class="button" value="Register" />266 <input type="button" onClick="window.location='<?= $page ?>?op=inputNewAccount';" class="button" value="Register" /> 262 267 </td> 263 268 </tr> … … 275 280 <br /> 276 281 277 < %} else if( $shouldShowCreateForm ) {282 <?php } else if( $shouldShowCreateForm ) { 278 283 if( ! $errors ) 279 284 $mesg = " <h1>One-step signup</h1><br />"; 280 %>281 < %= $mesg %>285 ?> 286 <?= $mesg ?> 282 287 <br /> 283 288 … … 324 329 </script> 325 330 326 < %= $debug == 1 ? "<h1 style='color: red;'>* * * DEBUG IS ON * * *</h1>" : "" %>327 < % if( $errors ) { %>331 <?= $debug == 1 ? "<h1 style='color: red;'>* * * DEBUG IS ON * * *</h1>" : "" ?> 332 <?php if( $errors ) { ?> 328 333 329 334 <div class="alert" style="margin-bottom: 15px;"> 330 335 <h3>PLEASE CORRECT THE FOLLOWING:</h3> 331 <div class="warning">< %= $errors %></span>336 <div class="warning"><?= $errors ?></span> 332 337 </div> 333 338 <br /> 334 339 335 < % } %>336 337 <form name="create_account_form" action="<%= $page %>" method="POST" onSubmit="return(validateForm(this));">338 <input type="hidden" name="debug" value="< %= $debug %>" />340 <?php } ?> 341 342 <form name="create_account_form" id="create_account_form" action="<?= $page ?>" method="POST" onSubmit="return(validateForm(this));"> 343 <input type="hidden" name="debug" value="<?= $debug ?>" /> 339 344 <input type="hidden" name="op" value="createAccount" /> 340 345 <input type="hidden" name="errors" value="" /> … … 342 347 <tr> 343 348 <td align="right">Pick a <b>user name</b>:</td> 344 <td><input name="userId" maxlength="16" value="< %= $userId %>" class="text" />349 <td><input name="userId" maxlength="16" value="<?= $userId ?>" class="text" /> 345 350 <span class="subtle"> 346 351 (letters, numbers, underscores only) … … 350 355 <tr> 351 356 <td align="right">Enter your <b>email address</b>:</td> 352 <td><input name="email" maxlength="48" value="< %= $email %>"357 <td><input name="email" maxlength="48" value="<?= $email ?>" 353 358 class="text" /> <span class="subtle">(we 354 359 NEVER sell or share emails)</span></td> … … 356 361 <tr> 357 362 <td align="right">Pick a <b>password</b>:</td> 358 <td><input name="password" value="< %= $password %>" type="password" size="16" maxlength="16" class="text"/>363 <td><input name="password" value="<?= $password ?>" type="password" size="16" maxlength="16" class="text"/> 359 364 <span class="subtle"> 360 365 (16 letters or fewer) … … 364 369 <tr> 365 370 <td align="right">Re-type your password:</td> 366 <td><input name="password2" value="< %= $password2 %>" type="password" size="16" maxlength="16" class="text" /> </td>371 <td><input name="password2" value="<?= $password2 ?>" type="password" size="16" maxlength="16" class="text" /> </td> 367 372 </tr> 368 373 <tr> … … 373 378 </tr> 374 379 </table> <br /> 375 </form> < % } %>376 377 < %380 </form> <?php } ?> 381 382 <?php 378 383 $noXML = true; 379 384 if( ! $noFooter ) 380 385 include_once( "$modules/footer.inc.php" ); 381 %>386 ?> 382 387 383 388 </body> </html> feedmelinks/modules/utils.inc.php
r1348 r1349 6 6 include_once( "env.inc.php" ); 7 7 include( get_root() . "/modules/prep-cache.inc.php" ); 8 9 function IM_address_is_validated( $user ) { 10 if( ! $user ) 11 return false; 12 return false; 13 } 14 function get_IM_address_for_user( $user ) { 15 if( ! $user ) 16 return ""; 17 return getFieldForUser( $user, "im" ); 18 } 8 19 9 20 function show_peeps_feed( $user ) { … … 2922 2933 # this depends on the next being a closure: function is_banned( $u, $mesg ) { } 2923 2934 2924 function addUser( $argUserId, $argEmail, $argPassword, $argName ) {2935 function addUser( $argUserId, $argEmail, $argPassword, $argName, $argPostCode, $argIM, $argIMType, $argPostCode, $argIM, $argIMType ) { 2925 2936 2926 2937 # check to see if weve seen any new accounts from this IP recently … … 2938 2949 } 2939 2950 2940 $userId = urlencode( $argUserId ); 2941 $email = urlencode( $argEmail ); 2942 $password = urlencode( $argPassword ); 2943 $name = urlencode( $argName ); 2944 2945 $qs = "INSERT INTO users VALUES(NULL,'$userId','$email', '$password', '$name','', 2, 1, NULL, now(), now());"; 2951 $userId = urlencode( $argUserId ); 2952 $email = urlencode( $argEmail ); 2953 $password = urlencode( $argPassword ); 2954 $name = urlencode( $argName ); 2955 $post_code = urlencode( $argPostCode ); 2956 $im = urlencode( $argIM ); 2957 $im_type = urlencode( $argIMType ); 2958 2959 $qs = "INSERT INTO users VALUES(NULL,'$userId','$email', '$password', '$name','', 2, 1, NULL, now(), now(), '$post_code', '$im', '$im_type' );"; 2946 2960 2947 2961 l( "new_user: $argUserId, $argEmail" ); feedmelinks/style/main.css
r1307 r1349 374 374 background-color: #EEEEEE; 375 375 } 376