示例#1
0
文件: cpw.php 项目: EbrahemS/SRCMS
                    $errors[] = "Password [new] too long";
                }
                if (strlen($_POST['password_new']) < 6) {
                    $errors[] = "Passwrod [new] too short";
                }
                if ($_POST['password_new'] !== $_POST['password_new_confirm']) {
                    $errors[] = "New Passwords does not match!.";
                }
                if (count($errors) > 0) {
                    foreach ($errors as $nElement) {
                        echo $nElement . ".<br/>";
                    }
                    misc::back();
                } else {
                    //verify
                    if (user::RestorePass($_GET['uid'], $_POST['password_new'])) {
                        echo "Password changed successfully. <br/>";
                        misc::redirect('?pg=news', 1);
                    } else {
                        echo "Invalid old password specified.<br/>";
                        misc::back();
                    }
                }
            } else {
                core::$ucp->ForgotpwForm();
            }
        }
    }
} else {
    echo 'Entry is invalid.';
}
示例#2
0
 public static function sendWebPrivMsg($to, $from, $title, $text)
 {
     global $core;
     $msgTitle = security::toHTML($title);
     $msgText = security::toHTML($text);
     $senderJID = user::accountJIDbyUsername($from);
     $receiverJID = user::accountJIDbyUsername($to);
     if ($senderJID != $receiverJID) {
         if (core::$sql->numRows("select * from srcms_privatemessages where receiver='{$receiverJID}'") >= $core->aConfig['maxPrivMsg']) {
             echo "Receiver inbox is full.<br/>";
         } else {
             if (strlen($msgTitle) < $core->aConfig['minPrivMsgTitleLen'] || strlen($msgTitle) > $core->aConfig['maxPrivMsgTitleLen'] || strlen($msgText) < $core->aConfig['minPrivMsgBodyLen'] || strlen($msgText) > $core->aConfig['maxPrivMsgBodyLen']) {
                 echo "Message text, or title is too long or too short. Minimum title length is " . $core->aConfig['minPrivMsgTitleLen'] . " and " . $core->aConfig['maxPrivMsgTitleLen'] . "symbols\r\n\t\t\t\t\t\t\t\tmaximum. Message content minimum length is " . $core->aConfig['minPrivMsgBodyLen'] . " and " . $core->aConfig['maxPrivMsgBodyLen'] . " symbols maximum.<br/>";
                 misc::back();
             } else {
                 $datetime = misc::getDateTime();
                 core::$sql->exec("insert into srcms_privatemessages(sender,receiver, title, msg, viewed, time) values('{$senderJID}', '{$receiverJID}', '{$msgTitle}', '{$msgText}', '0', '{$datetime}')");
                 echo "<br/>Message sent.<br/>";
                 misc::redirect("?pg=ucp&act=mailbox", 2);
             }
         }
     } else {
         echo "You can't send message to yourself.<br/>";
         misc::back();
     }
 }