function op_delclient() { $t = true; if (isset($_POST['delete']) && is_array($_POST['delete'])) { include_once "ClientModel.class.php"; $clientModel = new ClientModel(); foreach ($_POST['delete'] as $u) { $t *= $clientModel->deleteClient($u); } if ($t) { show_message_goback(lang('success')); } } show_message(lang('selectone')); goback(); }
function op_resetpwd() { if (empty($_POST['code'])) { show_message_goback(lang('invalidurl')); } if (empty($_POST['newpwd1']) or empty($_POST['newpwd2'])) { show_message_goback(lang('insertpwd')); } $new1 = $_POST['newpwd1']; $new2 = $_POST['newpwd2']; if (strlen($new1) < 6 or strlen($new2) < 6) { show_message_goback(lang('pwdrule')); } if (trim($new1) != trim($new2)) { show_message_goback(lang('pwdnotsame')); } $code = $_POST['code']; include_once "PassportModel.class.php"; $passmod = new PassportModel(); $row = $passmod->checkForget($code); if ($row) { if (false != $passmod->updatePassByUser($row['user'], PassportModel::encryptpwd($new1, $row['user']))) { $passmod->updateForgetPwd($row['user']); show_message(lang('pwdreset')); redirect($GLOBALS['gSiteInfo']['www_site_url'] . '/index.php/passport/login'); } else { show_message_goback(lang('failture')); } } else { show_message(lang('invalidurl')); echo "<script> alert('" . lang('invalidurl') . "')</script>"; redirect($GLOBALS['gSiteInfo']['www_site_url'] . '/index.php/passport/login'); } }
function op_delonlineuser() { if (SSO_MODE != 'ticket') { show_message(lang('module_ban')); die; } $t = true; if (isset($_POST['delete']) && is_array($_POST['delete'])) { include_once "PassportModel.class.php"; $passport = new PassportModel(); foreach ($_POST['delete'] as $ticket) { $t *= $passport->deleteTicketById($ticket); } if ($t) { show_message_goback(lang('success')); } } show_message(lang('selectone')); goback(); }
function op_emailset() { if (isset($_POST['smtp_host'])) { $upate['smtp_host'] = $_POST['smtp_host']; } if (isset($_POST['smtp_port'])) { $upate['smtp_port'] = $_POST['smtp_port']; } if (isset($_POST['smtp_account'])) { $upate['smtp_account'] = $_POST['smtp_account']; } if (isset($_POST['smtp_pass'])) { $upate['smtp_pass'] = $_POST['smtp_pass']; } if (isset($_POST['smtp_from'])) { $upate['smtp_from'] = $_POST['smtp_from']; } include_once "SettingModel.class.php"; $settingModel = new SettingModel(); $r = $settingModel->updateSettings($upate); $config_content = file_get_contents(APP_DIR . "/config/config.ini.php"); $config_content = preg_replace('/(\\["smtp_host"\\]\\s*=\\s*)(.*?)(;)/ism', '\\1"' . $upate['smtp_host'] . '"\\3', $config_content); $config_content = preg_replace('/(\\["smtp_port"\\]\\s*=\\s*)(.*?)(;)/ism', '\\1"' . $upate['smtp_port'] . '"\\3', $config_content); $config_content = preg_replace('/(\\["smtp_account"\\]\\s*=\\s*)(.*?)(;)/ism', '\\1"' . $upate['smtp_account'] . '"\\3', $config_content); $config_content = preg_replace('/(\\["smtp_pass"\\]\\s*=\\s*)(.*?)(;)/ism', '\\1"' . $upate['smtp_pass'] . '"\\3', $config_content); $config_content = preg_replace('/(\\["smtp_from"\\]\\s*=\\s*)(.*?)(;)/ism', '\\1"' . $upate['smtp_from'] . '"\\3', $config_content); $r1 = write_file($config_content, APP_DIR . "/config/config.ini.php"); if ($r && $r1) { show_message_goback(lang('success')); } else { show_message_goback(lang('failed')); } }