* GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * @link http://www.easyscp.net * @author EasySCP Team */ require '../../include/easyscp-lib.php'; check_login(__FILE__); $cfg = EasySCP_Registry::get('Config'); $tpl = EasySCP_TemplateEngine::getInstance(); $template = 'client/sql_database_add.tpl'; // dynamic page data check_sql_permissions($sql, $_SESSION['user_id']); gen_page_post_data($tpl); add_sql_database($sql, $_SESSION['user_id']); // static page messages gen_logged_from($tpl); check_permissions($tpl); $tpl->assign(array('TR_PAGE_TITLE' => tr('EasySCP - Client/Add SQL Database'), 'TR_ADD_DATABASE' => tr('Add SQL database'), 'TR_DB_NAME' => tr('Database name'), 'TR_USE_DMN_ID' => tr('Use numeric ID'), 'TR_START_ID_POS' => tr('Before the name'), 'TR_END_ID_POS' => tr('After the name'), 'TR_ADD' => tr('Add'))); gen_client_mainmenu($tpl, 'client/main_menu_manage_sql.tpl'); gen_client_menu($tpl, 'client/menu_manage_sql.tpl'); gen_page_message($tpl); if ($cfg->DUMP_GUI_DEBUG) { dump_gui_debug($tpl); } $tpl->display($template); // page functions /**
$tpl->assign('ID', $db_id); } // // common page data. // if (isset($_SESSION['sql_support']) && $_SESSION['sql_support'] == "no") { header("Location: index.php"); } global $cfg; $theme_color = $cfg['USER_INITIAL_THEME']; $tpl->assign(array('TR_CLIENT_SQL_ADD_USER_PAGE_TITLE' => tr('VHCS - Client/Add SQL User'), 'THEME_COLOR_PATH' => "../themes/{$theme_color}", 'THEME_CHARSET' => tr('encoding'), 'TID' => $_SESSION['layout_id'], 'VHCS_LICENSE' => $cfg['VHCS_LICENSE'], 'ISP_LOGO' => get_logo($_SESSION['user_id']))); // // dynamic page data. // $sqluser_available = gen_sql_user_list($sql, $tpl, $_SESSION['user_id'], $db_id); check_sql_permissions($tpl, $sql, $_SESSION['user_id'], $db_id, $sqluser_available); gen_page_post_data($tpl, $db_id); add_sql_user($sql, $_SESSION['user_id'], $db_id); // // static page messages. // gen_client_menu($tpl); gen_logged_from($tpl); check_permissions($tpl); $tpl->assign(array('TR_ADD_SQL_USER' => tr('Add SQL user'), 'TR_USER_NAME' => tr('SQL user name'), 'TR_USE_DMN_ID' => tr('Use numeric ID'), 'TR_START_ID_POS' => tr('In front the name'), 'TR_END_ID_POS' => tr('Behind the name'), 'TR_ADD' => tr('Add'), 'TR_CANCEL' => tr('Cancel'), 'TR_ADD_EXIST' => tr('Add existing user'), 'TR_PASS' => tr('Password'), 'TR_PASS_REP' => tr('Password repeat'), 'TR_SQL_USER_NAME' => tr('Existing SQL users'))); gen_page_message($tpl); $tpl->parse('PAGE', 'page'); $tpl->prnt(); if (isset($cfg['DUMP_GUI_DEBUG'])) { dump_gui_debug(); }