if(isset($_GET["software-list-by-family"])){software_available_family();exit;} if(isset($_GET["software-list"])){software_list_by_family();exit;} if(isset($_GET["main-start"])){echo popup_main();exit;} if(isset($_GET["mysqlstatus"])){echo mysql_status();exit;} if(isset($_GET["main"])){echo mysql_main_switch();exit;} if(isset($_GET["mysqlenable"])){echo mysql_enable();exit;} if($_GET["script"]=="mysql_enabled"){echo js_mysql_enabled();exit;} if($_GET["script"]=="mysql_save_account"){echo js_mysql_save_account();exit;} if(isset($_GET["install_app"])){install_app();exit;} if(isset($_GET["InstallLogs"])){GetLogsStatus();exit;} if(isset($_GET["TestConnection-js"])){TestConnection_js();exit;} if(isset($_GET["testConnection"])){testConnection();exit;} if(isset($_GET["remove"])){remove();exit;} if(isset($_GET["uninstall_app"])){remove_perform();exit;} if(isset($_GET["remove-refresh"])){remove_refresh();exit;} if(isset($_GET["ui-samba"])){install_remove_services();exit;} if(isset($_GET["clear"])){clear();exit;} if(isset($_GET["SynSysPackages"])){SynSysPackages();exit;} if(isset($_GET["softwares-available"])){software_available();exit;} if(isset($_GET["remove-app-js"])){remove_app_js();exit;} if(isset($_POST["remove-app-perform"])){remove_app_perform();exit;} if(isset($_GET["RefreshMysqlSetup"])){RefreshMysqlSetup();exit;} if(posix_getuid()<>0){main_page();} function events_js(){ $page=CurrentPageName();
exit; } if (isset($_GET["install_app"])) { install_app(); exit; } if (isset($_GET["InstallLogs"])) { GetLogsStatus(); exit; } if (isset($_GET["TestConnection-js"])) { TestConnection_js(); exit; } if (isset($_GET["testConnection"])) { testConnection(); exit; } if (isset($_GET["remove"])) { remove(); exit; } if (isset($_GET["uninstall_app"])) { remove_perform(); exit; } if (isset($_GET["remove-refresh"])) { remove_refresh(); exit; } if (isset($_GET["ui-samba"])) {
$result->msg = G::LoadTranslation('ID_TITLE_COMPLETED'); echo G::json_encode($result); } catch (Exception $e) { $confParams = array('lang' => $lang, 'status' => 'failed'); $appCacheViewEngine = $oServerConf->setProperty('APP_CACHE_VIEW_ENGINE', $confParams); echo '{success: false, msg:"' . $e->getMessage() . '"}'; } break; case 'recreate-root': $user = $_POST['user']; $passwd = $_POST['password']; $server = $_POST['host']; $aServer = split(":", $server); $serverName = $aServer[0]; $port = count($aServer) > 1 ? $aServer[1] : "none"; list($sucess, $msgErr) = testConnection(DB_ADAPTER, $serverName, $user, $passwd, $port); if ($sucess) { $sh = md5(filemtime(PATH_GULLIVER . "/class.g.php")); $h = G::encrypt($_POST['host'] . $sh . $_POST['user'] . $sh . $_POST['password'] . $sh . 1, $sh); $insertStatements = "define ( 'HASH_INSTALLATION','{$h}' ); \ndefine ( 'SYSTEM_HASH', '{$sh}' ); \n"; $lines = array(); $content = ''; $filename = PATH_HOME . 'engine' . PATH_SEP . 'config' . PATH_SEP . 'paths_installed.php'; $lines = file($filename); $count = 1; foreach ($lines as $line_num => $line) { $pos = strpos($line, "define"); if ($pos !== false && $count < 3) { $content = $content . $line; $count++; }
} ///////End of functions if ($_SERVER['REQUEST_METHOD'] == "POST") { if (isset($_POST['TASK'])) { if ($_POST['TASK'] == 1) { //Create an Account: //CreateAccount($dbc, $_POST['userName'], $_POST['password']); } elseif ($_POST['TASK'] == 2) { //Register an new device: RegisternewDevice($dbc, $_POST['simpleName']); } } switch ($_POST['t']) { case '1': //Test Connection by returnuing the device ID. testConnection($dbc, $_POST['dt']); die; break; case '2': //Get all of the undisplayed Authenticated messages: if (checkValidation($dbc, $_POST['dt'])) { getUndisplayedMessages($dbc, $_POST['dt']); } else { error_log("API DeviceTocken Validation Failed"); die; } break; case '3': $DeviceID = getDeviceIDForDeviceTocken($dbc, $_POST['dt']); awkMessageDisplay($dbc, $DeviceID, $_POST['mid']); die;
$maxRetry = intval($mailSettings->variable('RoundRobinSettings', 'MaximumRetry')); $cli->output("Setting RoundRobin packagesize to: " . $packageSize); $cli->output("Found " . count($mailAccounts) . " Account(s)"); // get smtp accounts $i = 1; foreach ($mailAccounts as $account) { $parameters = array(); $parameters['host'] = $mailSettings->variable($account, 'ServerName'); $parameters['helo'] = $mailSettings->variable($account, 'ServerName'); $parameters['port'] = $mailSettings->variable($account, 'ServerPort'); if ($mailSettings->hasVariable($account, 'LoginName') and $mailSettings->hasVariable($account, 'Password')) { $parameters['auth'] = true; $parameters['user'] = $mailSettings->variable($account, 'LoginName'); $parameters['pass'] = $mailSettings->variable($account, 'Password'); } if (testConnection($parameters)) { $serverlist[$i] = $parameters; $i++; } } if (count($serverlist) == 0) { $cli->output("No valid mailserver accounts found!"); exit(1); } $cli->output("Available accounts: " . count($serverlist)); // get mail-files $sys = eZSys::instance(); $separator = $sys->osType() == 'win32' ? "\\" : "/"; $qdir = eZSys::siteDir() . eZSys::varDirectory() . $separator . 'mailq' . $separator; $cli->output("Fetching mail source files"); $mailFiles = glob($qdir . '*.mail');
// --> break; case 'deposit_logs': echo deposit_logs($conn); // --> break; case 'withdrawTransaction': echo withdrawTransaction($conn); // --> break; case 'depositTransaction': echo depositTransaction($conn); // --> break; case 'testConnection': echo testConnection(); break; case 'chk': echo get_chkDigit($_GET['brno'], $_GET['acct']); break; } function addProfile($conn) { extract($_GET); $data = explode('|', $data); $tempProfile = sqlanywhere_query($conn, "INSERT INTO gcash_TempProf (pnmbr, firstname, middlename, lastname, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t c_street, res_provincecode, c_brgy_town, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t c_zipcode, res_countrycode, p_street, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t p_province_city, p_brgy_town, countryorigin, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t bday, bplace, occupation, nationality, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t mobile, idtype, id_number, gender, email, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t maritalstatus, maiden_name) VALUES ('" . $data[0] . "', \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t '" . $data[1] . "', '" . $data[3] . "', '" . $data[2] . "', '" . $data[4] . "', \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t '" . $data[7] . "', '" . $data[6] . "', '" . $data[7] . "', \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t '" . $data[7] . "', '" . $data[9] . "', '" . $data[10] . "', \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t '" . $data[11] . "', '" . $data[13] . "', '" . date('Y-m-d', strtotime($data[14])) . "', '" . $data[15] . "', \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t '" . $data[16] . "', '" . $data[17] . "', '" . $data[18] . "', '" . $data[19] . "', '" . $data[20] . "', \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t '" . $data[21] . "', '" . $data[22] . "', '" . $data[23] . "', '" . $data[24] . "') "); return $tempProfile ? 1 : 0; } function updateProfile($conn) { extract($_GET);
$message = 'Tables is already exists!'; } } $res->json(array('success' => $success, 'message' => $message)); }); /** * 提交 */ $app->post('/setup', function ($req, $res) { $default_config = array(); $default_db = array('type' => 'mysql', 'host' => 'localhost', 'port' => '3306', 'dbname' => 'inews', 'username' => 'root', 'password' => '', 'charset' => 'utf8', 'options' => array()); $default_site = array('title' => 'iNews', 'title_suffix' => '- iNews', 'default_meta' => '', 'keywords' => '', 'footer' => '', 'search_bar' => '', 'menus' => array(array('Latest', '/latest', 'clock'), array('Leaders', '/leaders', 'user')), 'share_text' => '我在 {site_title} 分享了 {title}'); $db = $req->data('db'); $admin = $req->data('admin'); $config = $req->data('config'); if (!($pdo = testConnection($db))) { echo 'Mysql connect error!'; return; } /** * 初始化数据库 */ $sql = file_get_contents(APP_DIR . '/migrations/schema.sql'); $pdo->setAttribute(\PDO::ATTR_EMULATE_PREPARES, 0); try { $pdo->exec($sql); } catch (\PDOException $e) { echo 'SQL execute error!'; return; } /**