public static function checkAddon($addons) { $return = ''; foreach ($addons as $name => $version) { if (is_int($name)) { $name = $version; $version = false; } if (isset(rp::get('addons')[$name])) { $config = rp::get('addons')[$name]; } if (!isset($config) || !is_array($config)) { $return .= sprintf(lang::get('addon_not_found'), $name); continue; } if (!addonConfig::isActive($name)) { $return .= sprintf(lang::get('addon_not_install_active'), $name); continue; } if (rp::checkVersion($config['version'], $version) === false) { $return .= sprintf(lang::get('addon_need_version'), $name, $version); continue; } } if ($return == '') { return true; } else { return $return; } }
public static function replaceControl($game, $array) { $keys = []; $vals = []; $emailNot = rp::get('emailNot') ? 'on' : 'off'; $array = array_merge($array, ['ip' => rp::get('ip'), 'email' => rp::get('email'), 'emailNot' => $emailNot]); foreach ($array as $key => $val) { $keys[] = '{{' . $key . '}}'; $vals[] = $val; } return str_replace($keys, $vals, self::getControl($game)); }
protected function control($type) { $id = $this->id; $SSH = rp::get('SSH'); $host = $SSH['ip']; $user = $SSH['user']; $pass = $SSH['password']; unset($SSH); $ssh = new ssh($host, $user, $pass); $sql = new sql(); $sql->setTable('server'); $sql->setWhere('id=' . $id); #$ssh->read('[prompt]'); switch ($type) { case 'install': $ssh->exec("cd {$id}; ./control.sh auto-install > /dev/null &"); $sql->addPost('status', 0); break; case 'start': $ssh->exec("cd {$id}; ./control.sh start >> /dev/null 2>&1 & /n"); $sql->addPost('status', 1); break; case 'stop': $ssh->exec("cd {$id}; ./control.sh stop >> /dev/null 2>&1 & /n"); $sql->addPost('status', 0); break; case 'restart': $ssh->exec("cd {$id}; ./control.sh restart >> /dev/null 2>&1 & /n"); $sql->addPost('status', 1); break; } $sql->update(); }
echo message::success($success); } layout::addNav(lang::get('dashboard'), 'dashboard', 'home', ['refresh'], true); layout::addNav(lang::get('settings'), 'settings', 'settings', [], false); layout::addNav(lang::get('server'), 'server', 'list', ['add'], true); layout::addNav(lang::get('addons'), 'addons', 'alt', [], true); layout::addNav(lang::get('user'), 'user', 'users', ['add'], true); foreach (addonConfig::includeAllConfig() as $file) { include $file; } if (userLogin::isLogged()) { $path = 'pages/' . $page . '.php'; $path = extension::get('PAGE_PATH', $path); if (file_exists($path)) { include $path; } else { echo message::danger(lang::get('page_not_found'), false); } } $content = ob_get_contents(); ob_end_clean(); rp::add('content', $content); if (ajax::is()) { echo ajax::getReturn(); die; } if (userLogin::isLogged()) { include dir::layout('index.php', rp::get('layout')); } else { include dir::layout('login.php', rp::get('layout')); }
public static function svg($icon) { ob_start(); include dir::layout('icons/' . $icon . '.svg', rp::get('layout')); $return = ob_get_contents(); ob_end_clean(); return $return; }
<div class="panel"> <div class="content"> <div id="terminal"> <?php $SSH = rp::get('SSH'); $host = $SSH['ip']; $user = $SSH['user']; $pass = $SSH['password']; unset($SSH); $ssh = new ssh($host, $user, $pass); if (ajax::is()) { $test = 1; } else { echo nl2br($ssh->read('/.*@.*[$|#]/', NET_SSH2_READ_REGEX)); $ssh->write("screen -r test123 \n\r"); $ssh->setTimeout(4); $ssh->write("ping google.de \n\r"); } if (ajax::is()) { #$ssh->setTimeout(1); #$ssh->write("ping google.de \n\r"); $ssh->setTimeout(4); $ssh->exec("screen -r test123"); #$return = nl2br($ssh->read('/.*@.*[$|#]/', NET_SSH2_READ_REGEX)); ajax::addReturn($return); } ?> </div> </div> </div>
echo lang::get('yes'); ?> </div> </div> </div> </div> <div class="input row"> <label class="col-sm-4"><?php echo lang::get('email'); ?> </label> <div class="col-sm-8"> <input type="text" name="email" value="<?php echo rp::get('email'); ?> "> </div> </div> </div> </div> <button type="submit" class="mbt15" name="send"><?php echo lang::get('apply'); ?> </button> </div>
lang::setDefault(); lang::setLang(rp::get('lang')); $page = type::super('page', 'string', 'lang'); $action = type::super('action', 'string'); $lang = type::super('lang', 'string'); $id = type::super('id', 'int'); if ($lang) { lang::setLang($lang); rp::add('lang', $lang, true); rp::save(); } $success = type::get('success', 'string'); $error = type::get('error', 'string'); if (!is_null($error)) { echo message::danger($error); } elseif (!is_null($success)) { echo message::success($success); } $path = 'pages/' . $page . '.php'; if (file_exists($path)) { include $path; } else { echo message::danger(lang::get('page_not_found'), false); } $content = ob_get_contents(); ob_end_clean(); layout::addNav(lang::get('choose_lang'), 'lang', '', [], true); rp::add('content', $content); include 'inc/head.php'; echo rp::get('content'); include 'inc/foot.php';
$admin = isset($_POST['admin']) ? 1 : 0; $salt = userLogin::generateSalt(); $new->addPost('salt', $salt); $new->addPost('firstname', type::post('firstname')); $new->addPost('name', type::post('name')); $new->addPost('email', type::post('email')); $new->addPost('admin', $admin); $new->addPost('username', type::post('username')); $new->addPost('password', userLogin::hash(type::post('password'), $salt)); $new->save(); echo message::success(lang::get('user_added')); } if (isset($_POST['delete'])) { $ids = type::post('ids'); if (is_array($ids) && count($ids) >= 1) { if (in_array(rp::get('user')->get('id'), $ids)) { echo message::danger(lang::get('user_delete_own')); } else { foreach ($ids as $var) { $sql = new sql(); $sql->setTable('user'); $sql->setWhere("id=" . $var); $sql->delete(); } echo message::success(lang::get('user_deleted')); } } else { echo message::danger(lang::get('choose_user')); } } $table = new table();
<?php echo layout::svg('rocket-panel'); ?> </a> <form action="" method="post"> <input type="hidden" name="check" value="1"> <h1><?php echo lang::get('user'); ?> </h1> <?php if (isset($_POST['check'])) { $DB = rp::get('DB'); sql::connect($DB['host'], $DB['user'], $DB['password'], $DB['database']); unset($DB); $sql = new sql(); $salt = userLogin::generateSalt(); $sql->setTable('user'); $sql->addPost('firstname', type::post('firstname')); $sql->addPost('name', type::post('name')); $sql->addPost('username', type::post('username')); $sql->addPost('email', type::post('email')); $sql->addPost('password', userLogin::hash(type::post('password'), $salt)); $sql->addPost('salt', $salt); $sql->addPost('admin', 1); $sql->save(); rp::add('setup', false, true); rp::save();
public function getPosts($post) { if (!is_array($post) && rp::get('debug')) { throw new InvalidArgumentException(__CLASS__ . '::' . __METHOD__ . ' ertwartet als 1. Parameter ein array'); } foreach ($post as $val => $cast) { $this->values[$val] = $this->escape(type::post($val, $cast, '')); } return $this; }