示例#1
0
 if ($_POST['password'] == $_POST['confirmpassword']) {
     if (filter_var($_POST['email'], FILTER_VALIDATE_EMAIL) && strpos($_POST['email'], ".")) {
         if ($_POST['confirmemail']) {
             if ($_POST['email'] == $_POST['confirmemail']) {
                 if (strtolower($_POST['captcha']) == $_SESSION['captcha']) {
                     if ($_POST['agree'] == "on") {
                         $mQuery = $mysql->query("SELECT `id` FROM `accounts` WHERE `username` = '" . escape($_POST['username']) . "'");
                         if (!$mQuery->num_rows) {
                             $mQuery = $mysql->query("SELECT `id` FROM `accounts` WHERE `displayname` = '" . escape($_POST['displayname']) . "'");
                             if (!$mQuery->num_rows) {
                                 $mQuery = $mysql->query("SELECT `id` FROM `accounts` WHERE `email` = '" . escape($_POST['email']) . "'");
                                 if (!$mQuery->num_rows) {
                                     $validationKey = md5(rand());
                                     email($_POST['email'], "Lawless Boards: Account Validation", "Dear " . $_POST['displayname'] . ",\r\n\r\nThank you for registering at Lawless Boards.\r\n\r\nTo fully activate your account, please click on the link below:\r\n" . getCurrentPage() . "?key={$validationKey}");
                                     $mysql->query("INSERT INTO `accounts` (`username`, `password`, `displayname`, `email`, `birthday`, `country`, `timezone`, `key`, `ip`) VALUES ('" . escape($_POST['username']) . "', '" . password($_POST['password']) . "', '" . escape($_POST['displayname']) . "', '" . escape($_POST['email']) . "', '" . escape($_POST['birthday']) . "', '" . escape($_POST['country']) . "', '" . escape($_POST['timezone']) . "', '{$validationKey}', '" . $_SERVER['REMOTE_ADDR'] . "')");
                                     addUserGroup($mysql->insert_id, REGISTERED_GROUP, true);
                                     die("\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class='box'>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class='boxHeading'>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tYou have successfully registered an account. Please check your email inbox to activate it.\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t");
                                 } else {
                                     echo "<div class='box'>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class='boxHeading'>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAn account with this email is already registered.\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<br>";
                                 }
                             } else {
                                 echo "<div class='box'>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class='boxHeading'>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAn account with this display name is already registered.\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t<br>";
                             }
                         } else {
                             echo "<div class='box'>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<div class='boxHeading'>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tAn account with this user name is already registered.\n\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t\t\t\t\t<br>";
                         }
                     } else {
                         echo "<div class='box'>\n\t\t\t\t\t\t\t\t\t\t\t\t<div class='boxHeading'>\n\t\t\t\t\t\t\t\t\t\t\t\t\tYou did not agree to the rules.\n\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t\t\t\t<br>";
                     }
                 } else {
                     echo "<div class='box'>\n\t\t\t\t\t\t\t\t\t\t\t<div class='boxHeading'>\n\t\t\t\t\t\t\t\t\t\t\t\tYou have entered the captcha incorrectly.\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t\t\t<br>";
示例#2
0
function saveConfig()
{
    $mainframe = JFactory::getApplication();
    $database = JFactory::getDBO();
    $row = new joomla_flash_uploader($database);
    // if magic quotes is on we remove slashes forst because store does quote automatically!
    if (get_magic_quotes_gpc()) {
        $row->bind(array_map("stripslashes", $_POST));
    } else {
        $row->bind($_POST);
    }
    $row->last_modified_date = date("Y-m-d");
    $row->store();
    // now we update the users
    $userstring = JRequest::getVar('list_2_sent', '');
    $userchanged = JRequest::getVar('list_2_changed', '');
    // first we remove all user mappings and then we insert all the new ones.
    $database->setQuery("DELETE FROM #__joomla_flash_uploader_user WHERE location='site' and profile = ({$row->id})");
    $database->query();
    if ($userstring != '') {
        $userstringarray = explode(",", trim($userstring, " ,"));
        foreach ($userstringarray as $singleuser) {
            $rowuser = new joomla_flash_uploader_user($database);
            $rowuser->profile = $row->id;
            $rowuser->user = trim($singleuser);
            $rowuser->location = 'site';
            $rowuser->store();
        }
    }
    addUserGroup('site', 'jgroupfront', 'id', false);
    cleanMessageQueue();
    unset($_SESSION['IM_CHECK']);
    $mainframe->redirect("index.php?option=com_jfuploader&act=config", JText::_('MES_SAVED'));
}