コード例 #1
0
ファイル: index.php プロジェクト: BGCX261/zhpanel-svn-to-git
     $d = dir($tpl_dir);
     $themes = array();
     while ($f = $d->read()) {
         $param_file = "{$tpl_dir}/{$f}/param.ini";
         if (!is_file($param_file)) {
             continue;
         }
         $param = parse_ini_file($param_file);
         $themes[] = (object) $param;
     }
     break;
 case 'sync':
     syncSystemUsers();
     syncFtpUsers();
     syncVhosts();
     syncCBand();
     syncCrontab();
     setmsg(t('All data updated!'), 'notice');
     break;
 case 'ctl':
     if (!isadmin()) {
         setmsg(t('Permission Denied'));
     }
     $a = strtolower($_REQUEST['a']);
     // Application
     $o = $_REQUEST['o'];
     // Operation
     if ($a == 'apache' && in_array($o, array('start', 'stop', 'restart'))) {
         $cmd = "/etc/init.d/apache2 {$o}";
     } elseif ($a == 'proftpd' && in_array($o, array('start', 'stop', 'restart'))) {
         $cmd = "/etc/init.d/proftpd {$o}";
コード例 #2
0
ファイル: user.php プロジェクト: BGCX261/zhpanel-svn-to-git
 $user = ZUser::getUser($name);
 if (!$user) {
     setmsg(t('No such user or this user is waiting for activation.'));
 }
 $op = @$_REQUEST['op'];
 if (checktoken()) {
     if ('chpasswd' == $op) {
         $new = $_REQUEST['password'];
         $res = ZUser::chpasswd_request($name, $new);
         $message = t("Password modification request submited. Please wait for a few minutes.");
         setmsg($message, 'notice', 'self');
     }
     if ('setpkg' == $op) {
         isadmin() || setmsg(t('Permission Dennied.'));
         $new = intval($_REQUEST['package']);
         $res = ZPackage::setUserPackage($name, $new) && syncCBand();
         $package_name = ZPackage::getPackage($new)->name;
         $message = t("Package for {$name} has been changed to ") . "[{$package_name}].";
         setmsg($message, 'notice', 'self');
     }
     if ('shell' == $op) {
         isadmin() || setmsg(t('Permission Dennied.'));
         $new = $_REQUEST['shell'];
         $res = ZShell::setUserShell($name, $new);
         $message = t("Shell for {$name} has been changed to ") . "[{$new}].";
         setmsg($message, 'notice', 'self');
     }
     if ('suspend' == $op) {
         if (ZUser::suspendUser($name, !intval($_REQUEST['suspend']))) {
             setmsg('', 'notice');
         } else {
コード例 #3
0
function sync()
{
    syncFtpUsers();
    syncVhosts();
    syncCBand();
    syncSystemUsers();
    syncCrontab();
    syncQuota();
}