本文整理汇总了PHP中lxfile_unix_chown函数的典型用法代码示例。如果您正苦于以下问题:PHP lxfile_unix_chown函数的具体用法?PHP lxfile_unix_chown怎么用?PHP lxfile_unix_chown使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了lxfile_unix_chown函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dbactionAdd
function dbactionAdd()
{
global $gbl, $sgbl, $login, $ghtml;
$dir = $this->main->__var_full_directory;
$dir = expand_real_root($dir);
$pass = $this->main->realpass;
if (!$pass) {
$pass = randomString(8);
}
lxshell_input("{$pass}\n{$pass}\n", "pure-pw", "useradd", $this->main->nname, "-u", $this->main->__var_username, "-d", $dir, "-m");
if (!lxfile_exists($dir)) {
lxfile_mkdir($dir);
lxfile_unix_chown($dir, $this->main->__var_username);
}
$this->setQuota();
// If the user is added is fully formed, this makes sure that all his properties are synced.
$this->toggleStatus();
}
示例2: createUser
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 = "a{$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;
}
示例3: readAuthorizedKey
static function readAuthorizedKey($username)
{
$p = os_get_home_dir($username);
if ($p === '/tmp' && $username) {
if (!lxfile_exists("/home/{$username}")) {
lxfile_mkdir("/home/{$username}");
lxshell_return("usermod", "-d", "/home/{$username}", $username);
lxfile_unix_chown("/home/{$username}", "{$username}:{$username}");
$p = "/home/{$username}";
}
}
if (!$p) {
return;
}
$f = "{$p}/.ssh/authorized_keys";
if (lxfile_exists("{$f}2")) {
$s = lfile_get_contents("{$f}2");
$s = "\n{$s}\n";
lxuser_put_contents($username, $f, $s, FILE_APPEND);
lunlink("{$f}2");
}
return lfile_get_contents($f);
}
示例4: fullUpdate
function fullUpdate()
{
global $gbl, $sgbl, $login, $ghtml;
$domname = $this->main->nname;
$uname = $this->main->username;
$hroot = $sgbl->__path_httpd_root;
$droot = $this->main->getFullDocRoot();
lxfile_mkdir("{$hroot}/{$domname}/webstats");
$this->main->createPhpInfo();
web::createstatsConf($domname, $this->main->stats_username, $this->main->stats_password);
self::createSSlConf($this->main->__var_ipssllist, $this->main->__var_domainipaddress);
$this->createConffile();
// Removed recursive
lxfile_unix_chown("{$droot}/", "{$uname}:{$uname}");
lxfile_unix_chmod("{$droot}/", "0755");
lxfile_unix_chmod("{$droot}", "0755");
lxfile_unix_chown("{$hroot}/{$domname}", "{$uname}:apache");
}
示例5: setProgramSsl
static function setProgramSsl($contentpem, $contentsca)
{
lfile_put_contents("../etc/program.pem", $contentpem);
if ($contentsca) {
lfile_put_contents("../etc/program.ca", $contentsca);
}
lxfile_unix_chown("../etc/program.pem", "lxlabs:lxlabs");
lxfile_unix_chown("../etc/program.ca", "lxlabs:lxlabs");
}
示例6: createHtpasswordFile
function createHtpasswordFile($object, $sdir, $list)
{
$dir = "__path_httpd_root/{$object->main->getParentName()}/{$sdir}/";
$loc = $object->main->directory;
$file = get_file_from_path($loc);
$dirfile = "{$dir}/{$file}";
if (!lxfile_exists($dir)) {
lxfile_mkdir($dir);
lxfile_unix_chown($dir, $object->main->__var_username);
}
$fstr = null;
foreach ($list as $k => $p) {
$cr = crypt($p);
$fstr .= "{$k}:{$cr}\n";
}
dprint($fstr);
lfile_write_content($dirfile, $fstr, $object->main->__var_username);
lxfile_unix_chmod($dirfile, "0755");
}
示例7: dbactionUpdate
function dbactionUpdate($subaction)
{
global $gbl, $sgbl, $login, $ghtml;
if_demo_throw_exception('ffile');
$this->aux = new Ffile__common(null, null, $this->nname);
$this->aux->main = $this->main;
if ($this->main->isOn('readonly')) {
throw new lxexception('file_manager_is_readonly', '');
}
$chownug = "{$this->main->__username_o}:{$this->main->__username_o}";
switch ($subaction) {
case "fancyedit":
case "edit":
lxuser_put_contents($chownug, $this->main->getFullPath(), $this->main->content);
lxuser_return($chownug, "dos2unix", $this->main->getFullPath());
lxuser_chmod($chownug, $this->main->getFullPath(), "0644");
break;
case "upload_s":
$filename = $this->aux->uploadDirect();
lxuser_chmod($chownug, $filename, "0644");
lxfile_generic_chown($filename, $chownug);
break;
case "rename":
$this->aux->reName();
break;
case "paste":
$this->aux->filePaste();
break;
case "perm":
$arg = null;
$perm = $this->main->newperm;
$perm = 0 . $perm;
if ($this->main->isOn('recursive_f')) {
new_process_chmod_rec($this->main->__username_o, $this->main->fullpath, $perm);
} else {
lxfile_unix_chmod($this->main->fullpath, "{$perm}");
}
break;
case "newdir":
$path = $this->aux->newDir();
lxfile_unix_chown($path, $chownug);
break;
case "content":
if ($this->main->is_image()) {
$this->aux->resizeImage();
} else {
throw new lxexception('cannot_save_content', '');
}
break;
case "thumbnail":
$this->aux->createThumbnail();
break;
case "convert_image":
$this->aux->convertImage();
break;
case "zip_file":
$zipfile = $this->aux->zipFile();
break;
case "filedelete":
$this->aux->moveAllToTrash();
break;
case "filerealdelete":
$this->aux->fileRealDelete();
break;
case "restore_trash":
$this->aux->restoreTrash();
break;
case "clear_trash":
$this->aux->clearTrash();
break;
case "download_from_http":
$fullpath = $this->aux->downloadFromHttp();
lxfile_unix_chown($fullpath, $chownug);
break;
case "download_from_ftp":
$fullpath = $this->aux->downloadFromFtp();
lxfile_unix_chown($fullpath, $chownug);
break;
case "zipextract":
$dir = $this->aux->zipExtract();
break;
}
}
示例8: lxfile_generic_chown
function lxfile_generic_chown($file, $mod)
{
lxfile_unix_chown($file, $mod);
}
示例9: syncCreateConf
function syncCreateConf()
{
global $gbl, $sgbl, $login, $ghtml;
// $host = `hostname`;
$dlistv = "__var_domainlist_{$this->main->__var_syncserver}";
$result = $this->main->{$dlistv};
$nameduser = "tinydns";
$dnsfile = "/var/tinydns/root/data";
//dprintr($result);
$result = merge_array_object_not_deleted($result, $this->main);
if (!$this->main->isDeleted()) {
foreach ((array) $this->main->__var_addonlist as $d) {
$result = merge_array_object_not_deleted($result, $d);
}
}
$cdata = null;
foreach ((array) $result as $value) {
$cdata .= " {$value['nname']}.data ";
}
$cdata = trim($cdata);
if ($cdata) {
$cmd = "cd /var/tinydns/root/kloxo/ ; cat {$cdata} > ../data";
log_log("dns_log", $cmd);
system($cmd);
} else {
system("rm /var/tinydns/root/data");
}
lxfile_unix_chown($dnsfile, $nameduser);
lxshell_directory("/var/tinydns/root/", "make");
lxshell_directory("/var/tinydns/root/", "tinydns-data");
}
示例10: updateupload_Logo
function updateupload_Logo($param)
{
global $gbl, $sgbl, $login, $ghtml;
$progname = $sgbl->__var_program_name;
$parent = $this->getParentO();
$imgname = $parent->getClName();
// $param['specialplay_b-logo_image'] = "/img/logo/$imgname.gif";
// $param['specialplay_b-logo_image_loading'] = "/img/logo/$imgname-loading.gif";
// make_sure_directory_is_lxlabs("__path_program_htmlbase/img/logo");
$param['specialplay_b-logo_image'] = "/img/user-logo.png";
$fullpath_logo_image = __path_program_htmlbase . $param['specialplay_b-logo_image'];
// temporary only for admin - 6.1.7
if ($_FILES['logo_image_f']['tmp_name']) {
lxfile_mv($_FILES['logo_image_f']['tmp_name'], $fullpath_logo_image);
}
/*
else {
lxfile_cp("__path_program_htmlbase/img/$progname-logo.gif", "__path_program_htmlbase" . $param['specialplay_b-logo_image']);
}
*/
lxfile_cp($fullpath_logo_image, "/usr/local/lxlabs/kloxo/file/user-logo.png");
// must chown to lxlabs for successful display on 'Upload Logo'
lxfile_unix_chown($fullpath_logo_image, "lxlabs");
passthru("lxphp.exe /usr/local/lxlabs/kloxo/bin/fix/fix-userlogo.php --select=all");
/*
if ($_FILES['logo_image_loading_f']['tmp_name']) {
lxfile_mv($_FILES['logo_image_loading_f']['tmp_name'], "__path_program_htmlbase" .$param['specialplay_b-logo_image_loading']);
} else {
lxfile_cp("__path_program_htmlbase/img/$progname-splash.gif", "__path_program_htmlbase" . $param['specialplay_b-logo_image_loading']);
}
*/
$tsp = $parent->getObject("sp_childspecialplay");
$tsp->specialplay_b->logo_image = $param['specialplay_b-logo_image'];
// $tsp->specialplay_b->logo_image_loading = $param['specialplay_b-logo_image_loading'];
$tsp->setUpdateSubaction('upload_logo');
$this->setUpdateSubaction('upload_logo');
return $param;
}
示例11: fullUpdate
function fullUpdate()
{
global $gbl, $sgbl, $login, $ghtml;
$this->createConffile();
$this->createSuexec();
// $this->updateMainConfFile();
self::createSSlConf($this->main->__var_ipssllist, $this->main->__var_domainipaddress);
// self::createWebDefaultConfig();
web::createstatsConf($this->main->nname, $this->main->stats_username, $this->main->stats_password);
$log_path = "/home/httpd/{$this->main->nname}/stats";
lxfile_unix_chown_rec($log_path, "{$this->main->username}:apache");
lxfile_unix_chmod_rec($log_path, "770");
$this->main->createPhpInfo();
lxfile_unix_chown("__path_httpd_root/{$this->main->nname}", "{$this->main->username}:apache");
lxfile_unix_chmod("__path_httpd_root/{$this->main->nname}", "0755");
lxfile_unix_chmod("{$this->main->getFullDocRoot()}", "0755");
}
示例12: syncCreateConf
function syncCreateConf()
{
global $gbl, $sgbl, $login, $ghtml;
// $host = `hostname`;
$result = $this->main->__var_domainlist;
$fdata = null;
$dnsfile = "{$sgbl->__path_mara_conf}";
$nameduser = $sgbl->__var_programuser_dns;
$iplist = os_get_allips();
$iplist[] = "127.0.0.1";
$iplist = implode(",", $iplist);
$fdata = "csv2 = {}\n";
$fdata .= "chroot_dir = \"/etc/maradns\"\n";
$fdata .= "ipv4_bind_addresses=\"{$iplist}\"\n";
$fdata .= "recursive_acl=\"0.0.0.0/0\"\n";
$result = merge_array_object_not_deleted($result, $this->main);
if (!$this->main->isDeleted()) {
foreach ((array) $this->main->__var_addonlist as $d) {
$result = merge_array_object_not_deleted($result, $d);
}
}
foreach ((array) $result as $value) {
$tmp = "csv2[\"{$value['nname']}.\"] = \"{$value['nname']}\"\n";
$fdata .= $tmp;
}
lfile_put_contents($dnsfile, $fdata);
lxfile_unix_chown($dnsfile, $nameduser);
}
示例13: createIniFile
function createIniFile()
{
$pclass = $this->main->getParentClass();
$ver = find_php_version();
$this->initString($ver);
$header = lfile_get_contents("../file/phpini/php.ini.template-{$ver}");
$cont = lfile_get_contents("../file/phpini/php.ini.temp");
$htcont = lfile_get_contents("../file/phpini/htaccesstemp");
$vlist = array("enable_zend_val", "enable_ioncube_val", "enable_xcache_val");
$l1 = $this->main->getInheritedList();
$l2 = $this->main->getLocalList();
$l3 = $this->main->getExtraList();
$ll = lx_array_merge(array($l1, $l2, $l3));
$list = array_unique($ll);
foreach ($list as $l) {
$vl = strtil($l, "_flag") . "_val";
if (array_search_bool($vl, $vlist)) {
continue;
}
list($cont, $htcont) = $this->replacestr(array($cont, $htcont), $l);
}
foreach ($vlist as $vl) {
list($cont) = $this->replacestr(array($cont), $vl);
}
$stlist[] = "###Start Kloxo PHP config Area";
$stlist[] = "###Start Lxdmin Area";
$stlist[] = "###Start Kloxo Area";
$stlist[] = "###Start Lxadmin PHP config Area";
$endlist[] = "###End Kloxo PHP config Area";
$endlist[] = "###End Kloxo Area";
$endlist[] = "###End Lxadmin PHP config Area";
$endstring = $endlist[0];
$startstring = $stlist[0];
if ($pclass === 'pserver') {
$file = "/etc/php.ini";
if (!lxfile_exists("__path_kloxo_back_phpini")) {
lxfile_cp("/etc/php.ini", "__path_kloxo_back_phpini");
}
$this->enableDisableModule("enable_xcache_flag", "xcache");
$htfile = null;
$extrafile = "/etc/custom.php.ini";
if (lxfile_exists($extrafile)) {
$extrastring = lfile_get_contents($extrafile);
$cont = "{$extrastring}\n{$cont}";
} else {
$cont = "{$cont}";
}
} else {
$dname = $this->main->getParentName();
$elogfile = "/home/{$this->main->__var_customer_name}/__processed_stats/{$this->main->getParentName()}.phplog";
$file = "__path_httpd_root/{$this->main->getParentName()}/php.ini";
$extrafile = "__path_httpd_root/{$this->main->getParentName()}/custom.php.ini";
if (lxfile_exists($extrafile)) {
$extrastring = lfile_get_contents($extrafile);
} else {
$extrastring = "";
}
// ToDo #590 - disable appear on .htaccess
// REVERT - back to enable because mod_php tend to share-based php.ini
// and some parameters of domain specific must be declare inside .htaccess
$htfile = "{$this->main->__var_docrootpath}/.htaccess";
$ht1file = "/home/{$this->main->__var_customer_name}/kloxoscript/.htaccess";
$htcont = "php_value error_log \"{$elogfile}\"\n{$htcont}";
$htcont = str_replace("\n", "\n\t", $htcont);
$htcont = str_replace($htcont, "\t" . $htcont, $htcont);
$htcont = "\n<Ifmodule mod_php4.c>\n{$htcont}\n</Ifmodule>\n\n<Ifmodule mod_php5.c>\n{$htcont}\n</Ifmodule>\n";
file_put_between_comments("{$this->main->__var_web_user}:apache", $stlist, $endlist, $startstring, $endstring, $htfile, $htcont);
file_put_between_comments("{$this->main->__var_web_user}:apache", $stlist, $endlist, $startstring, $endstring, $ht1file, $htcont);
lxfile_unix_chown($htfile, "{$this->main->__var_web_user}:apache");
// MR --- set the same like AddOpenBaseDir() on web__apachelib.php
$clname = $this->main->__var_customer_name;
$adminbasedir = trim($this->main->__var_extrabasedir);
if ($adminbasedir) {
$adminbasedir .= ":";
}
if (!$this->main->isOn('__var_disable_openbasedir')) {
$path = "{$adminbasedir}";
$path .= "/home/{$clname}:";
$path .= "/home/{$clname}/kloxoscript:";
$path .= "/home/httpd/{$dname}:";
$path .= "/home/httpd/{$dname}/httpdocs:";
$path .= "/tmp:";
$path .= "/usr/share/pear:";
$path .= "/var/lib/php/session:";
$path .= "/home/kloxo/httpd/script";
$cont = "open_basedir = \"{$path}\"\n\n{$cont}";
}
$cont = "error_log = \"{$elogfile}\"\n{$cont}";
$cont = "{$extrastring}\n{$cont}";
}
lxfile_rm($file);
lfile_put_contents($file, "{$header}\n{$cont}\n");
createRestartFile($this->main->__var_webdriver);
}
示例14: setSomePermissions
function setSomePermissions()
{
log_cleanup("Install/Fix Services/Permissions/Configfiles");
if (!lxfile_exists("/usr/bin/lxphp.exe")) {
log_cleanup("- Create lxphp.exe Symlink");
lxfile_symlink("__path_php_path", "/usr/bin/lxphp.exe");
}
log_cleanup("- Set permissions for /usr/bin/php-cgi");
lxfile_unix_chmod("/usr/bin/php-cgi", "0755");
log_cleanup("- Set permissions for closeallinput binary");
lxfile_unix_chmod("../cexe/closeallinput", "0755");
log_cleanup("- Set permissions for lxphpsu binary");
lxfile_unix_chown("../cexe/lxphpsu", "root:root");
lxfile_unix_chmod("../cexe/lxphpsu", "0755");
lxfile_unix_chmod("../cexe/lxphpsu", "ug+s");
log_cleanup("- Set permissions for phpsuexec.sh script");
lxfile_unix_chmod("../file/phpsuexec.sh", "0755");
log_cleanup("- Set permissions for /home/kloxo/httpd/lighttpd/ dir");
system("chown -R apache:apache /home/kloxo/httpd/lighttpd/");
log_cleanup("- Set permissions for /var/lib/php/session/ dir");
system("chmod 777 /var/lib/php/session/");
system("chmod o+t /var/lib/php/session/");
log_cleanup("- Set permissions for /var/bogofilter/ dir");
system("chmod 777 /var/bogofilter/");
system("chmod o+t /var/bogofilter/");
log_cleanup("- Kill sisinfoc system process");
system("pkill -f sisinfoc");
}
示例15: lscandir_without_dot
if ($drec->param === $oldip) {
$drec->param = $newip;
}
}
}
$dns->was();
}
}
$list = lscandir_without_dot("/home/httpd");
foreach ($list as $l) {
if (!is_dir("/home/httpd/{$l}")) {
continue;
}
lxfile_unix_chown_rec("/home/httpd/{$l}/stats/", "apache");
}
$driverapp = $gbl->getSyncClass(null, 'localhost', 'web');
if ($driverapp === 'apache') {
// --- issue #589
// addLineIfNotExistInside("/etc/httpd/conf/httpd.conf", "Include /etc/httpd/conf/kloxo/kloxo.conf", "");
lxshell_return("__path_php_path", "../bin/misc/installsuphp.php");
} else {
lxfile_cp("../file/lighttpd/lighttpd.conf", "/etc/lighttpd/lighttpd.conf");
// --- issue #598
// lxfile_cp("../file/lighttpd/conf/kloxo/kloxo.conf", "/etc/lighttpd/conf/kloxo/kloxo.conf");
// lxfile_cp("../file/lighttpd/conf/kloxo/webmail.conf", "/etc/lighttpd/conf/kloxo/webmail.conf");
lxfile_cp("../file/lighttpd/~lxcenter.conf", "/etc/lighttpd/conf.d/~lxcenter.conf");
lxfile_cp("../file/lighttpd/conf/kloxo/webmail.conf", "/home/lighttpd/conf/defaults/webmail.conf");
lxfile_mkdir("/home/kloxo/httpd/lighttpd");
lxfile_unix_chown("/home/kloxo/httpd/lighttpd", "apache");
}
print "\n\n";