Exemple #1
0
 function set_privvmpages($privvmpages, $force = false)
 {
     global $db;
     if ($this->exists && $_SESSION["is_admin"] || $force) {
         $vm = limit_privvmpages_by_id($privvmpages);
         $vzctl = "{$vm["vm_lim_soft"]}M" . ($vm["vm_lim_hard"] ? ":{$vm["vm_lim_hard"]}M" : '');
         $sql = 'UPDATE vps SET vps_privvmpages = "' . $db->check($privvmpages) . '" WHERE vps_id = ' . $db->check($this->veid);
         $db->query($sql);
         if ($db->affected_rows() == 1) {
             $command = '--privvmpages ' . $vzctl;
             $this->ve["vps_privvmpages"] = $privvmpages;
             add_transaction($_SESSION["member"]["m_id"], $this->ve["vps_server"], $this->veid, T_EXEC_LIMITS, $command);
         } else {
             return array('0' => '');
         }
     }
 }
Exemple #2
0
     $xtpl->title(_("VPS details") . ' ' . _("[User mode]"));
 }
 if (!$vps->exists) {
     $vps = vps_load($veid);
 }
 $vps->info();
 $xtpl->table_add_category(' ');
 $xtpl->table_add_category(' ');
 $xtpl->table_td('ID:');
 $xtpl->table_td($vps->veid);
 $xtpl->table_tr();
 $xtpl->table_td(_("Owner") . ':');
 $xtpl->table_td($vps->ve["m_nick"]);
 $xtpl->table_tr();
 $xtpl->table_td(_("RAM") . ':');
 $privvmpages = limit_privvmpages_by_id($vps->ve["vps_privvmpages"]);
 $xtpl->table_td($privvmpages["vm_label"]);
 $xtpl->table_tr();
 $xtpl->table_td(_("Disk space") . ':');
 $diskspace = limit_diskspace_by_id($vps->ve["vps_diskspace"]);
 $xtpl->table_td($diskspace["d_label"]);
 $xtpl->table_tr();
 $xtpl->table_td(_("Status") . ':');
 $xtpl->table_td($vps->ve["vps_up"] ? _("running") . ' <a href="?page=adminvps&action=info&run=stop&veid=' . $vps->veid . '">(' . _("stop") . ')</a>' : _("stopped") . ' <a href="?page=adminvps&action=info&run=start&veid=' . $vps->veid . '">(' . _("start") . ')</a>');
 $xtpl->table_tr();
 $xtpl->table_td(_("Processes") . ':');
 $xtpl->table_td($vps->ve["vps_nproc"]);
 $xtpl->table_tr();
 $xtpl->table_td(_("Hostname") . ':');
 $xtpl->table_td($vps->ve["vps_hostname"]);
 $xtpl->table_tr();