示例#1
0
 public function m_signUp($values)
 {
     global $system, $settings, $lang;
     $timeStamp = time();
     // if(strstr($values['userName'], '@')){
     // $filter = "`email` = '$values[userName]'";
     // $signUpFlag = 'email';
     // }else{
     // $filter = "`userName` = '$values[userName]'";
     // $signUpFlag = 'userName';
     // }
     if ($system->dbm->db->count_records("`{$this->userTable}`", "`email` = '{$values['email']}'") == 0) {
         // if($values['password'] == $values['retypePassword']){
         if (strlen($values['password']) >= $settings['minCharPassword']) {
             if ($_POST['securityQuestion'] === $system->dbm->db->informer("`faqObject`", "`id` = {$_POST['securityId']}", "answer")) {
                 $password = md5($values['password']);
                 $system->dbm->db->insert("`{$this->userTable}`", "`active`, `timeStamp`, `owner`, `group`, `or`, `ow`, `ox`, `gr`, `gx`, `tr`, `tx`, `gid`, `password`, `email`, `uType`", "1, '{$timeStamp}', 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, '{$password}', '{$values['email']}', 2");
                 $id = $system->dbm->db->insert_id();
                 @mkdir("home/{$id}/images", 0777, true);
                 @mkdir("home/{$id}/_thumbs", 0777, true);
                 @mkdir("home/{$id}/files", 0777, true);
                 @fopen("home/{$id}/images/index.html", w);
                 @fopen("home/{$id}/_thumbs/index.html", w);
                 @fopen("home/{$id}/files/index.html", w);
                 require_once 'module/basket/model/basket.php';
                 m_basket::m_move($_SESSION['uid'], $id);
                 $this->m_login($id, 2, 2);
                 $system->watchDog->exception('s', $lang['add'], sprintf($lang['successfulDone'], $lang['userAdd'], $values['email']) . $lang['pleaseWait'], null, "setTimeout('location.href=\\'/\\';', 5000);");
             } else {
                 $system->watchDog->exception("e", $lang['error'], $lang['securityAnswerIsIncorrect']);
             }
         } else {
             $system->watchDog->exception("e", $lang['error'], sprintf($lang['passwordIsTooShortMinIs'], $settings['minCharPassword']));
         }
         // }else{
         // $system->watchDog->exception("e", $lang['error'], $lang['passwordsNotMatch']);
         // }
     } else {
         $system->watchDog->exception("e", $lang['error'], $lang['userNameExist']);
     }
 }