function createUser()
 {
     global $gbl, $sgbl, $login, $ghtml;
     if (!$sgbl->isKloxo()) {
         return;
     }
     $password = $this->main->password;
     $cmd = "useradd";
     $shell = fix_disabled("--Disabled--", $sgbl->__var_noaccess_shell);
     $username = $this->main->getPathFromName();
     if (is_numeric($username[0])) {
         $username = "******";
     }
     $username = os_create_system_user($username, $password, $this->main->nname, $shell, "__path_customer_root/{$this->main->getPathFromName()}/");
     lxfile_unix_chown("__path_customer_root/{$this->main->getPathFromName()}", "{$username}:apache");
     lxfile_unix_chmod("__path_customer_root/{$this->main->getPathFromName()}", "750");
     $this->main->username = $username;
     $this->setQuota();
     $ret = array("__syncv_username" => $username);
     return $ret;
 }
<?php

include_once "htmllib/lib/include.php";
initProgram('admin');
$list = posix_getpwnam('admin');
if (!$list) {
    os_create_system_user('admin', $login->password, 'admin', '/sbin/nologin', '/home/admin');
    lxfile_unix_chown_rec("/home/admin", "admin");
    //fixes issue #515
    lxfile_generic_chmod("/home/admin", "0770");
    lxshell_return("__path_php_path", "../bin/misc/fixwebdnsfullupdate.php");
    lxshell_return("__path_php_path", "../bin/misc/fixftpuserclient.phps");
}
Exemple #3
0
 static function create_user($name, $passwd, $id, $shell)
 {
     return os_create_system_user($name, $passwd, $id, $shell, "/home/{$name}");
 }
Exemple #4
0
function createOSUserAdmin()
{
    log_cleanup("- Create OS system user admin");
    if (!posix_getpwnam('admin')) {
        log_cleanup("- User admin created");
        os_create_system_user('admin', randomString(7), 'admin', '/sbin/nologin', "/home/admin");
    } else {
        log_cleanup("- User admin exists");
    }
}