Exemplo n.º 1
0
 function onAuthenticate($credentials, $options = null)
 {
     // Check Login
     //------------------------------------------------------------------------------
     $data = ext_find_user($credentials['username'], null);
     // Username not existing
     if ($data === NULL) {
         return false;
     }
     require_once _EXT_PATH . '/libraries/PasswordHash.php';
     $hasher = new PasswordHash(8, FALSE);
     $result = $hasher->CheckPassword($credentials['password'], $data[1]);
     if (!$result) {
         $data = ext_find_user($credentials['username'], $credentials['password']);
         if ($data == NULL) {
             return false;
         }
     }
     // 	Set Login
     $_SESSION['credentials_extplorer']['username'] = $data[0];
     $_SESSION['credentials_extplorer']['password'] = $data[1];
     $_SESSION['file_mode'] = 'extplorer';
     $GLOBALS["home_dir"] = str_replace('\\', '/', $data[2]);
     $GLOBALS["home_url"] = $data[3];
     $GLOBALS["show_hidden"] = $data[4];
     $GLOBALS["no_access"] = $data[5];
     $GLOBALS["permissions"] = $data[6];
     return true;
 }
Exemplo n.º 2
0
function ext_remove_user($user)
{
    $data =& ext_find_user($user, NULL);
    if ($data == NULL) {
        return false;
    }
    // Remove
    $data = NULL;
    // Copy Valid Users
    $cnt = count($GLOBALS["users"]);
    for ($i = 0; $i < $cnt; ++$i) {
        if ($GLOBALS["users"][$i] != NULL) {
            $ext_save_users[] = $GLOBALS["users"][$i];
        }
    }
    $GLOBALS["users"] = $ext_save_users;
    return ext_save_users();
}
Exemplo n.º 3
0
function edituser($dir)
{
    // Edit User
    $user = stripslashes($GLOBALS['__POST']["nuser"]);
    $data = ext_find_user($user, NULL);
    if ($data == NULL) {
        ext_Result::sendResult('edituser', false, $user . ": " . $GLOBALS["error_msg"]["miscnofinduser"]);
    }
    if ($self = $user == $GLOBALS['__SESSION']['credentials_extplorer']['username']) {
        $dir = "";
    }
    if (isset($GLOBALS['__POST']["confirm"]) && $GLOBALS['__POST']["confirm"] == "true") {
        $nuser = stripslashes($GLOBALS['__POST']["nuser"]);
        if ($nuser == "" || $GLOBALS['__POST']["home_dir"] == "") {
            ext_Result::sendResult('edituser', false, $GLOBALS["error_msg"]["miscfieldmissed"]);
        }
        if (isset($GLOBALS['__POST']["chpass"]) && $GLOBALS['__POST']["chpass"] == "on") {
            if ($GLOBALS['__POST']["pass1"] != $GLOBALS['__POST']["pass2"]) {
                ext_Result::sendResult('edituser', false, $GLOBALS["error_msg"]["miscnopassmatch"]);
            }
            $pass = extEncodePassword(stripslashes($GLOBALS['__POST']["pass1"]));
        } else {
            $pass = $data[1];
        }
        if ($self) {
            $GLOBALS['__POST']["active"] = 1;
        }
        $data = array($nuser, $pass, stripslashes($GLOBALS['__POST']["home_dir"]), stripslashes($GLOBALS['__POST']["home_url"]), $GLOBALS['__POST']["show_hidden"], stripslashes($GLOBALS['__POST']["no_access"]), $GLOBALS['__POST']["permissions"], $GLOBALS['__POST']["active"]);
        if (!ext_update_user($user, $data)) {
            ext_Result::sendResult('edituser', false, $user . ": " . $GLOBALS["error_msg"]["saveuser"]);
        }
        /*if($self) {
        			activate_user($nuser,NULL);
        		}*/
        ext_Result::sendResult('edituser', true, $user . ": " . ext_Lang::msg('User Profile has been updated'));
    }
    show_userform($data);
}