Пример #1
0
 function create()
 {
     global $gorumuser, $gorumauthlevel;
     $this->activateVariableFields();
     LocationHistory::resetPost();
     $this->initClassVars();
     LocationHistory::savePost($this);
     if (!$this->validRegistration()) {
         return FALSE;
     }
     unset($this->isAdm);
     $this->active = FALSE;
     // Majd az elso bejelentkezes utan lesz true
     $plainPassword = $this->generatePassword();
     $this->setDefaultsOfFieldsThatDontAppearInForm();
     if ($gorumauthlevel == Loginlib_GuestLevel) {
         // don't create a new user, only updating the current
         // nameless user with the newly registered username and
         // password:
         $this->id = $gorumuser->id;
         modify($this);
         if (Roll::isFormInvalid()) {
             return;
         }
     } else {
         if ($gorumauthlevel == Loginlib_BasicLevel || $gorumauthlevel == Loginlib_LowLevel) {
             generateRandomId($randomId);
             $this->id = $randomId;
             create($this);
             if (Roll::isFormInvalid()) {
                 return;
             }
         }
     }
     $this->storeAttachment();
     load($this);
     // hogy a notification minden mezot tartalmazhasson
     $this->sendPassword($plainPassword, Notification_initialPassword, "youWillGetAEmailCheckEmail");
     return $plainPassword;
 }
Пример #2
0
 public static function generateSessionId()
 {
     return generateRandomId() . hash("md5", $_SERVER['REMOTE_ADDR']);
 }
Пример #3
0
function createFirstAdmin()
{
    global $gorumauthlevel, $gorumuser, $gorumroll;
    global $gorumrecognised, $registrationType, $now;
    global $cookiePath, $user_typ, $noFirstAdmin, $infoText;
    if (empty($noFirstAdmin)) {
        $gorumauthlevel = Loginlib_LowLevel;
        $gorumrecognised = TRUE;
        $gorumuser = new User();
        if (isset($_COOKIE["globalUserId"])) {
            $gorumuser->id = $_COOKIE["globalUserId"];
        } else {
            generateRandomId($gorumuser->id);
        }
        $gorumuser->name = "admin";
        $gorumuser->password = getPassword("admin");
        if (isset($user_typ["attributes"]["email"])) {
            $gorumuser->email = "";
        }
        $gorumuser->isAdm = TRUE;
        if ($registrationType == User_emailCheck) {
            $gorumuser->active = TRUE;
        }
        $gorumuser->lastClickTime = $now;
        create($gorumuser);
        // azert hogy az isAdm es hasonlok is ki legyenek benne toltve:
        load($gorumuser);
        setcookie("usrPassword", $gorumuser->password, Loginlib_ExpirationDate, $cookiePath);
        setcookie("sessionUserId", $gorumuser->id, 0, $cookiePath);
    }
}