Update of /cvsroot/gallery/gallery In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9643 Modified Files: ChangeLog Version.php add_comment.php login.php modify_user.php register.php util.php view_album.php Log Message: 2005-07-30 Jens Tkotz <je...@pe...> 1.5.1-RC2-cvs-b6 * Change: Mailing o Moved Mail related functions into new lib/mail.php o Removed gallery_validate_email(), now only use check_email() - login.php - register.php - lib/mail.php - classes/Album.php - setup/check_mail.php - setup/functions.inc o reordered Notification mail. First now the message, then the disclaimer. * Fix: Mailing o Recipients ($to) for gallery_mail() where mixed in some cases. Now always a proper array. o Emailprefix should be a prefix, not a suffix ;) o emailLogMessage() was not compliant to gallery_mail(). Tweaked both. o unhtmlentities() on some email subjects * Change: Lots of intenting. * Change: Added "done" Button in manage_users.php Index: login.php =================================================================== RCS file: /cvsroot/gallery/gallery/login.php,v retrieving revision 1.65 retrieving revision 1.66 diff -u -d -r1.65 -r1.66 --- login.php 17 Apr 2005 13:31:37 -0000 1.65 +++ login.php 30 Jul 2005 20:51:08 -0000 1.66 @@ -106,37 +106,40 @@ echo makeFormIntro("login.php", array("name" => "forgot_form", "method" => "POST")); if (!empty($forgot)) { - $tmpUser = $gallery->userDB->getUserByUsername($username); - if ($tmpUser) { - $wait_time=15; - if ($tmpUser->lastAction == "new_password_request" && - time() - $tmpUser->lastActionDate < $wait_time * 60) { - echo gallery_error(sprintf(_("The last request for a password was less than %d minutes ago. Please check for previous email, or wait before trying again."), $wait_time)); - - } else if (gallery_validate_email($tmpUser->getEmail())) { - if (gallery_mail( $tmpUser->email, - _("New password request"), - sprintf(_("Someone requested a new password for user %s from Gallery '%s' on %s. You can create a password by visiting the link below. If you didn't request a password, please ignore this mail. "), $username, $gallery->app->galleryTitle, $gallery->app->photoAlbumURL) . "\n\n" . - sprintf(_("Click to reset your password: %s"), - $tmpUser->genRecoverPasswordHash()) . "\n", - sprintf(_("New password request %s"), $username))) { - $tmpUser->log("new_password_request"); - $tmpUser->save(); + $tmpUser = $gallery->userDB->getUserByUsername($username); + if ($tmpUser) { + $wait_time=15; + if ($tmpUser->lastAction == "new_password_request" && + time() - $tmpUser->lastActionDate < $wait_time * 60) { + echo gallery_error(sprintf(_("The last request for a password was less than %d minutes ago. Please check for previous email, or wait before trying again."), $wait_time)); + + } else if (check_email($tmpUser->getEmail())) { + if (gallery_mail( $tmpUser->email, + _("New password request"), + sprintf(_("Someone requested a new password for user %s from Gallery '%s' on %s. You can create a password by visiting the link below. If you didn't request a password, please ignore this mail. "), $username, $gallery->app->galleryTitle, $gallery->app->photoAlbumURL) . "\n\n" . + sprintf(_("Click to reset your password: %s"), + $tmpUser->genRecoverPasswordHash()) . "\n", + sprintf(_("New password request %s"), $username))) { + $tmpUser->log("new_password_request"); + $tmpUser->save(); echo sprintf(_("An email has been sent to the address stored for %s. Follow the instructions to change your password. If you do not receive this email, please contact the Gallery administrators."),$username) ?> <br><br> <form> <input type="button" value="<?php echo _("Dismiss") ?>" onclick='parent.close()'> </form> <?php - } else { - echo gallery_error(sprintf(_("Email could not be sent. Please contact %s administrators for a new password"),$gallery->app->galleryTitle )); - } - return; - } else { - echo gallery_error(sprintf(_("There is no valid email for this account. Please contact %s administrators for a new password"),$gallery->app->galleryTitle )); - } - } else { - echo gallery_error(_("Not a valid username")); - } - } + } + else { + echo gallery_error(sprintf(_("Email could not be sent. Please contact %s administrators for a new password"),$gallery->app->galleryTitle )); + } + return; + } + else { + echo gallery_error(sprintf(_("There is no valid email for this account. Please contact %s administrators for a new password"),$gallery->app->galleryTitle )); + } + } + else { + echo gallery_error(_("Not a valid username")); + } + } ?> <table align="center"> Index: add_comment.php =================================================================== RCS file: /cvsroot/gallery/gallery/add_comment.php,v retrieving revision 1.49 retrieving revision 1.50 diff -u -d -r1.49 -r1.50 --- add_comment.php 23 Jun 2005 10:07:46 -0000 1.49 +++ add_comment.php 30 Jul 2005 20:51:08 -0000 1.50 @@ -25,37 +25,36 @@ require_once(dirname(__FILE__) . '/init.php'); // Hack check - if (!$gallery->user->canAddComments($gallery->album)) { echo _("You are not allowed to perform this action!"); - exit; + exit; } list($save, $id, $commenter_name, $comment_text) = getRequestVar(array('save', 'id', 'commenter_name', 'comment_text')); -$error_text = ""; +$error_text = ''; if ($gallery->user->isLoggedIn() ) { if (empty($commenter_name) || $gallery->app->comments_anonymous == 'no') { - $commenter_name=user_name_string($gallery->user->getUID(), - $gallery->app->comments_display_name); + $commenter_name=user_name_string($gallery->user->getUID(), + $gallery->app->comments_display_name); } } elseif (!isset($commenter_name)) { - $commenter_name=''; + $commenter_name = ''; } if (empty($comment_text)) { - $comment_text=''; + $comment_text = ''; } if (isset($gallery->app->comments_length)) { - $maxlength=$gallery->app->comments_length; + $maxlength = $gallery->app->comments_length; } else { - $maxlength=0; + $maxlength = 0; } if (isset($save)) { - if ( empty($commenter_name) || empty($comment_text)) { - $error_text = _("Name and comment are both required to save a new comment!"); + if ( empty($commenter_name) || empty($comment_text)) { + $error_text = _("Name and comment are both required to save a new comment!"); } elseif ($maxlength >0 && strlen($comment_text) > $maxlength) { $error_text = sprintf(_("Your comment is too long, the admin set maximum length to %d chars"), $maxlength); } elseif (isBlacklistedComment($tmp = array('commenter_name' => $commenter_name, 'comment_text' => $comment_text), false)) { @@ -65,12 +64,14 @@ $commenter_name = removeTags($commenter_name); $IPNumber = $_SERVER['REMOTE_ADDR']; $gallery->album->addComment($id, $comment_text, $IPNumber, $commenter_name); + $gallery->album->save(); emailComments($id, $comment_text, $commenter_name); + // Note: In stats.php this causes the browser to show a message about POST data ... dismissAndReload(); return; - } + } } doctype(); ?> @@ -85,17 +86,14 @@ <p><?php echo _("Enter your comment for this picture in the text box below.") ?></p> <?php - echo $gallery->album->getThumbnailTagById($id); +echo $gallery->album->getThumbnailTagById($id); if (!empty($error_text)) { echo "\n<br>". gallery_error($error_text); } echo "<br><br>"; - - - -echo makeFormIntro("add_comment.php", +echo makeFormIntro("add_comment.php", array("name" => "theform", "method" => "POST"), - array('type' => 'popup')); + array('type' => 'popup')); drawCommentAddForm($commenter_name, 35); ?> @@ -105,7 +103,7 @@ </form> </div> <script language="javascript1.2" type="text/JavaScript"> -<!-- +<!-- // position cursor in top form field document.theform.commenter_name.focus(); //--> @@ -113,4 +111,4 @@ </div> <?php print gallery_validation_link("add_comment.php", true, array('id' => $id)); ?> </body> -</html> +</html> \ No newline at end of file Index: Version.php =================================================================== RCS file: /cvsroot/gallery/gallery/Version.php,v retrieving revision 1.1448 retrieving revision 1.1449 diff -u -d -r1.1448 -r1.1449 --- Version.php 29 Jul 2005 17:21:30 -0000 1.1448 +++ Version.php 30 Jul 2005 20:51:08 -0000 1.1449 @@ -31,7 +31,7 @@ $gallery = new stdClass(); } -$gallery->version = '1.5.1-RC2-cvs-b5'; +$gallery->version = '1.5.1-RC2-cvs-b6'; $gallery->config_version = 93; $gallery->album_version = 37; $gallery->user_version = 6; Index: util.php =================================================================== RCS file: /cvsroot/gallery/gallery/util.php,v retrieving revision 1.537 retrieving revision 1.538 diff -u -d -r1.537 -r1.538 --- util.php 23 Jul 2005 13:59:44 -0000 1.537 +++ util.php 30 Jul 2005 20:51:13 -0000 1.538 @@ -137,7 +137,7 @@ } function viewComments($index, $addComments, $page_url, $newestFirst = false, $addType = '', $album=false) { - global $gallery; + global $gallery; global $commentdraw; global $i; global $commenter_name; @@ -1427,25 +1427,28 @@ return 1; } [...1002 lines suppressed...] - usort($data, $sort_func); - } -} + if($keepIndexes) { + uasort($data, $sort_func); + } else { + usort($data, $sort_func); + } +} /** * @param string Optional former searchh string @@ -3695,5 +3432,6 @@ require_once(dirname(__FILE__) . '/lib/Form.php'); require_once(dirname(__FILE__) . '/lib/voting.php'); require_once(dirname(__FILE__) . '/lib/albumItem.php'); +require_once(dirname(__FILE__) . '/lib/mail.php'); ?> \ No newline at end of file Index: ChangeLog =================================================================== RCS file: /cvsroot/gallery/gallery/ChangeLog,v retrieving revision 1.1714 retrieving revision 1.1715 diff -u -d -r1.1714 -r1.1715 --- ChangeLog 29 Jul 2005 17:21:31 -0000 1.1714 +++ ChangeLog 30 Jul 2005 20:51:07 -0000 1.1715 @@ -1,3 +1,27 @@ +2005-07-30 Jens Tkotz <je...@pe...> 1.5.1-RC2-cvs-b6 + + * Change: Mailing + o Moved Mail related functions into new lib/mail.php + o Removed gallery_validate_email(), now only use check_email() + - login.php + - register.php + - lib/mail.php + - classes/Album.php + - setup/check_mail.php + - setup/functions.inc + o reordered Notification mail. First now the message, then the disclaimer. + + * Fix: Mailing + o Recipients ($to) for gallery_mail() where mixed in some cases. + Now always a proper array. + o Emailprefix should be a prefix, not a suffix ;) + o emailLogMessage() was not compliant to gallery_mail(). Tweaked both. + o unhtmlentities() on some email subjects + + * Change: Lots of intenting. + + * Change: Added "done" Button in manage_users.php + 2005-07-29 Jens Tkotz <je...@pe...> 1.5.1-RC2-cvs-b5 * Fix: Added missing { in classes/Mail/smtp.php. Index: register.php =================================================================== RCS file: /cvsroot/gallery/gallery/register.php,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- register.php 9 Mar 2005 19:25:06 -0000 1.29 +++ register.php 30 Jul 2005 20:51:13 -0000 1.30 @@ -63,8 +63,8 @@ $allowChange["send_email"] = false; $allowChange["member_file"] = false; -$errorCount=0; -if (!empty($formaction) && $formaction =='create') { +$errorCount = 0; +if (!empty($formaction) && $formaction == 'create') { // Security check. $uname = removeTags($uname); @@ -78,7 +78,7 @@ $errorCount++; } - if (!gallery_validate_email($email)) { + if (!check_email($email)) { $gErrors['email'] = _("You must specify a valid email address."); $errorCount++; } Index: view_album.php =================================================================== RCS file: /cvsroot/gallery/gallery/view_album.php,v retrieving revision 1.309 retrieving revision 1.310 diff -u -d -r1.309 -r1.310 --- view_album.php 23 Jul 2005 13:59:45 -0000 1.309 +++ view_album.php 30 Jul 2005 20:51:14 -0000 1.310 @@ -177,7 +177,8 @@ </head> <body dir="<?php echo $gallery->direction ?>"> -<?php } +<?php +} includeHtmlWrap("album.header"); Index: modify_user.php =================================================================== RCS file: /cvsroot/gallery/gallery/modify_user.php,v retrieving revision 1.44 retrieving revision 1.45 diff -u -d -r1.44 -r1.45 --- modify_user.php 19 Jun 2005 13:44:33 -0000 1.44 +++ modify_user.php 30 Jul 2005 20:51:09 -0000 1.45 @@ -163,6 +163,7 @@ <br> <input type="submit" name="save" value="<?php echo _("Save") ?>"> <input type="submit" name="dismiss" value="<?php echo _("Back to usermanagement") ?>"> +<input type="button" value="<?php echo _("Done") ?>" onclick='parent.close()'> </form> </div> |