本文整理汇总了PHP中ser函数的典型用法代码示例。如果您正苦于以下问题:PHP ser函数的具体用法?PHP ser怎么用?PHP ser使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ser函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
public function index()
{
$obj = ser($this->_get('param'), 1);
$p = isset($obj->p) ? intval($obj->p) : 1;
$this->assign('obj', $obj);
$this->display();
}
示例2: personsave
public function personsave()
{
if (IS_POST) {
if ($this->_post("per_id") == '') {
if ($this->Cusperson->create()) {
$biry = $this->_post("biryear") == '' ? '0000' : $this->_post("biryear");
$this->Cusperson->birthday = $biry . '-' . $this->_post("birday");
if ($this->Cusperson->add()) {
$this->success("新增成功!", U("Dcusperson/personadd", 'param=' . json_encode(ser($this->_post('param'), 1)) . '&menuid=' . $this->_post('menuid') . '&id=' . $this->_post('id') . '&t=' . $this->_post('t')));
} else {
$this->error("新增失败!");
}
} else {
$this->error($this->Cusperson->getError());
}
} else {
if ($this->Cusperson->create()) {
$biry = $this->_post("biryear") == '' ? '0000' : $this->_post("biryear");
$this->Cusperson->birthday = $biry . '-' . $this->_post("birday");
if ($this->Cusperson->save() !== false) {
$this->success("更新成功!", U("Dcusperson/personadd", 'param=' . json_encode(ser($this->_post('param'), 1)) . '&menuid=' . $this->_post('menuid') . '&id=' . $this->_post('id') . '&t=' . $this->_post('t')));
} else {
$this->error("更新失败!");
}
} else {
$this->error($this->Cusperson->getError());
}
}
}
}
示例3: personsave
public function personsave()
{
if (IS_POST) {
if ($this->_post("per_id") == '') {
if ($this->Cusperson->create()) {
$this->Cusperson->opr_name = AppframeAction::$Cache['User']['username'];
$this->Cusperson->opr_time = date('Y-m-d H:i:s');
if ($this->Cusperson->add()) {
$this->success("新增成功!", U("Dwtfzhmsg/personadd", 'param=' . json_encode(ser($this->_post('param'), 1)) . '&menuid=' . $this->_post('menuid') . '&id=' . $this->_post('id') . '&t=' . $this->_post('t')));
} else {
$this->error("新增失败!");
}
} else {
$this->error($this->Cusperson->getError());
}
} else {
if ($this->Cusperson->create()) {
$this->Cusperson->opr_name = AppframeAction::$Cache['User']['username'];
$this->Cusperson->opr_time = date('Y-m-d H:i:s');
if ($this->Cusperson->save() !== false) {
$this->success("更新成功!", U("Dwtfzhmsg/personadd", 'param=' . json_encode(ser($this->_post('param'), 1)) . '&menuid=' . $this->_post('menuid') . '&id=' . $this->_post('id') . '&t=' . $this->_post('t')));
} else {
$this->error("更新失败!");
}
} else {
$this->error($this->Cusperson->getError());
}
}
}
}
示例4: check
/**
* Check if CSRF token matches
*/
public static function check($echo = true)
{
if (self::$token === Request::get("csrfToken")) {
return true;
} else {
if ($echo) {
echo ser("Error", "CSRF Token doesn't match. Try again.");
}
return false;
}
}
示例5: csrf
/**
* CSRF token check
*/
public static function csrf($type = false)
{
if ($type == "s") {
// Output as string
return urlencode($_COOKIE['csrf_token']);
} elseif ($type == "g") {
// Output as a GET parameter
return "&csrf_token=" . urlencode($_COOKIE['csrf_token']);
} elseif ($type !== false) {
// Output as an input field
echo "<input type='hidden' name='csrf_token' value='{$_COOKIE['csrf_token']}' />";
} else {
// Check CSRF validity
if ($_COOKIE['csrf_token'] == self::input('csrf_token')) {
return true;
} else {
ser("Error", "CSRF Token doesn't match. Try again.");
return false;
}
}
}
示例6: array
<?php
$this->setTitle("New App");
?>
<div class="contents">
<h1>Add App</h1>
<?php
$app_info = array("id" => \Request::get("app_id"), "name" => \Request::get("app_name"), "git_url" => \Request::get("app_download"), "requires" => \Request::get("app_requires"), "short_description" => \Request::get("app_short_description"), "description" => \Request::get("app_description"), "category" => \Request::get("app_category"), "sub_category" => \Request::get("app_sub_category"), "version" => \Request::get("app_version"), "page" => \Request::get("app_page"), "author_id" => \Request::get("author_id"));
if (isset($_POST['app_id']) && array_search(null, $app_info) === false && CSRF::check()) {
$apps_sql = \Lobby\DB::getDBH()->prepare("SELECT COUNT(1) FROM `apps` WHERE `id` = ?");
$apps_sql->execute(array($app_info['id']));
if ($apps_sql->fetchColumn() != 0) {
ser("App Exists", "Hmmm... Looks like the App ID you submitted already exists either on App Center Or in the App Queue. " . \Lobby::l("/apps/{$app_info['id']}", "See Existing App"));
} else {
$app_info["logo"] = isset($_POST["app_logo"]) ? "1" : "0";
$lobby_web = isset($_POST['app_lobby_web']) ? 1 : 0;
$sql = \Lobby\DB::getDBH()->prepare("INSERT INTO `apps` (`id`, `name`, `version`, `logo`, `requires`, `git_url`, `description`, `short_description`, `category`, `sub_category`, `app_page`, `author`, `lobby_web`, `updated`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, NOW());");
$sql->execute(array($app_info['id'], $app_info['name'], $app_info['version'], $app_info['logo'], $app_info['requires'], $app_info['git_url'], $app_info['description'], $app_info['short_description'], $app_info['category'], $app_info['sub_category'], $app_info['page'], $app_info['author_id'], $lobby_web));
require_once __DIR__ . "/../../inc/LobbyGit.php";
$LG = new LobbyGit($app_info["id"], $app_info["git_url"]);
$LG->register();
sss("App Added", "App was added to the repository");
}
}
?>
<form action="<?php
echo \Lobby::u();
?>
" method="POST">
<label>
<span>App ID</span>
示例7: ser
$this->setTitle("Change Password");
?>
<div class="contents">
<h2>Change Password</h2>
<?php
if (isset($_POST['change_password'])) {
$curPass = $_POST['current_password'];
$newPass = $_POST['new_password'];
$retypePass = $_POST['retype_password'];
if ($curPass != null && $newPass != null && $retypePass != null) {
if (!\Fr\LS::login("admin", $curPass, false, false)) {
echo ser("Login Failed", "Couldn't login to your account to change password.");
} else {
if ($newPass !== $retypePass) {
echo ser("Passwords Doesn't match"), "The passwords you entered didn't match. Try again.</p></p>";
} else {
$changePass = \Fr\LS::changePassword($newPass);
if ($changePass === true) {
echo sss("Password Changed Successfully", "Your password was updated.");
}
}
}
} else {
echo "<p><h2>Password Fields was blank</h2><p>Form fields were left blank</p></p>";
}
}
?>
<form action="<?php
echo \Lobby::u();
?>
示例8: statusRoutes
public static function statusRoutes()
{
/**
* The default 404 page
*/
self::$router->onHttpError(function ($code, $router) {
if ($code == 404) {
ser();
}
});
}
示例9: makeConfigFile
/**
* Make the config.php file
*/
public static function makeConfigFile()
{
$lobbyID = self::randStr(10) . self::randStr(15) . self::randStr(20);
// Lobby Global ID
$lobbySID = hash("sha512", self::randStr(15) . self::randStr(30));
// Lobby Secure ID
$configFileLoc = L_DIR . "/config.php";
$cfg = self::$database;
/* Make the configuration file */
$config_sample = \Lobby\FS::get("/includes/lib/core/Inc/config-sample.php");
$config_file = $config_sample;
$config_file = preg_replace("/host'(.*?)'(.*?)'/", "host'\$1'{$cfg['host']}'", $config_file);
$config_file = preg_replace("/port'(.*?)'(.*?)'/", "port'\$1'{$cfg['port']}'", $config_file);
$config_file = preg_replace("/username'(.*?)''/", "username'\$1'{$cfg['username']}'", $config_file);
$config_file = preg_replace("/password'(.*?)''/", "password'\$1'{$cfg['password']}'", $config_file);
$config_file = preg_replace("/dbname'(.*?)''/", "dbname'\$1'{$cfg['dbname']}'", $config_file);
$config_file = preg_replace("/lobbyID'(.*?)''/", "lobbyID'\$1'{$lobbyID}'", $config_file);
$config_file = preg_replace("/secureID'(.*?)''/", "secureID'\$1'{$lobbySID}'", $config_file);
$config_file = preg_replace("/prefix'(.*?)'(.*?)'/", "prefix'\$1'{$cfg['prefix']}'", $config_file);
/**
* Create the config.php file
*/
if (\Lobby\FS::write($configFileLoc, $config_file) === false) {
ser("Failed Creating Config File", "Something happened while creating the file. Perhaps it was something that you did ?");
} else {
chmod(L_DIR . "/config.php", 0550);
}
}
示例10: array
if (isset($_POST['app_name'])) {
$app_info_required = array("id" => $app_edit ? $path[3] : \Request::get("app_id"), "name" => \Request::get("app_name"), "git_url" => \Request::get("app_src"), "description" => \Request::get("app_description"), "category" => \Request::get("app_category"), "sub_category" => \Request::get("app_sub_category"), "app_page" => \Request::get("app_page"));
$app_info = array_merge($app_info, $app_info_required);
$app_info["lobby_web"] = isset($_POST["app_lobby_web"]) ? "1" : "0";
$app_info["logo"] = isset($_POST["app_logo"]) ? "1" : "0";
}
if (isset($_POST['app_name']) && CSRF::check() && array_search(null, $app_info_required) === false) {
$apps_sql = \Lobby\DB::getDBH()->prepare("SELECT COUNT(1) FROM `apps` WHERE `id` = ?");
$apps_sql->execute(array($app_info['id']));
$queue_sql = \Lobby\DB::getDBH()->prepare("SELECT COUNT(1) FROM `apps_queue` WHERE `id` = ?");
$queue_sql->execute(array($app_info['id']));
if ($app_edit != true && ($queue_sql->fetchColumn() != 0 || $apps_sql->fetchColumn() != 0)) {
ser("App Exists", "Hmmm... Looks like the App ID you submitted already exists either on App Center Or in the App Queue. " . \Lobby::l("/apps/{$app_info['id']}", "See Existing App"));
} else {
if ($app_edit != true && preg_match("/\\b(?:(?:https?|ftp):\\/\\/|www\\.)[-a-z0-9+&@#\\/%?=~_|!:,.;]*[-a-z0-9+&@#\\/%=~_|]/i", $app_info['git_url']) == 0) {
ser("Invalid URL", "The app's source code URL you provided was invalid.");
} else {
if ($app_edit != true) {
$sql = \Lobby\DB::getDBH()->prepare("INSERT INTO `apps_queue` (`id`, `name`, `src`, `description`, `category`, `sub_category`, `app_page`, `author`, `updated`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, NOW());");
$sql->execute(array($app_info['id'], $app_info['name'], $app_info['git_url'], $app_info['description'], $app_info['category'], $app_info['sub_category'], $app_info['app_page'], \Fr\LS2::$user));
$admin_access_token = \Fr\LS2::getUser("username", 1);
require_once $this->dir . "/src/inc/open.auth.php";
$Opth = new OpenAuth("EAtGbLfgxiCJxhwWfsLsyxA0p8Zj4oUyOd4POaVc", "80d23edfa535caf4cc44b91e16c55c0f09e3bed927fecff96b092df0f517f410");
$Opth->action("email", array("subject" => "Lobby App Review", "body" => "Dude, a person requested to review her/his app ({$app_info['id']}). Please go and check it. http://lobby.subinsb.com"), $admin_access_token);
sss("App Submitted", "Your app was added to the review queue. You will be notified by email about your app's review status.");
} else {
$sql = \Lobby\DB::getDBH()->prepare("UPDATE `apps` SET `name` = ?, `logo` = ?, `description` = ?, `category` = ?, `sub_category` = ?, `app_page` = ?, `lobby_web` = ?, `updated` = NOW() WHERE `id` = ? AND `author` = ?");
$sql->execute(array($app_info['name'], $app_info['logo'], $app_info['description'], $app_info['category'], $app_info['sub_category'], $app_info['app_page'], $app_info['lobby_web'], $app_info['id'], \Fr\LS2::$user));
sss("Updated", "Your app was successfully updated.");
}
}
示例11: U
<tr>
<th class="w10 aright">状态{:C("separator");}</th>
<td class="w90">{$sel:sts}</td>
</tr>
<tr>
<td colspan="2">
<?php
if ($menurole['a_m'] == 'Y') {
?>
<button class="btn btn_submit mr10 J_ajax_submit_btn" type="submit">确定</button><?php
}
?>
<input type="button" class="btn btn_submit mr10 J_ajax_submit_btn" value="返回联系人列表" onclick="backcuslist();">
<!--<input type="button" class="btn btn_submit mr10 J_ajax_submit_btn" value="返回客户资料列表" onclick="window.location.href='<?php
echo U($menuinfo['model'] . '/index', 'parentid=0&menuid=' . $menuinfo[id] . '¶m=' . ser($param) . '&t=a');
?>
'">-->
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="btn_wrap">
<div class="btn_wrap_pd">
</div>
</div>
示例12: alert_user
function alert_user($user)
{
list($qmail, $pss) = ser("mail,pass", $_SESSION['qdu'] . ' WHERE name="' . $user . '"');
$subj = "{$qb} - tentative de login";
$txt = 'rappel de vos identifiants:
login: ' . $user . ', passw: ' . $pss . '
--
' . host();
$adminmail = $_SESSION['qbin']['adminmail'];
$tet = "From: {$adminmail} \n";
mail($qmail, $subj, $txt, $tet);
return lj('small', "valid_loged", "password sent to user {$user} {$qmail}");
}
示例13: alternate_design
function alternate_design($node_clr)
{
$_SESSION['switch'] = 1;
$_SESSION['tab'] = '';
define_mods($node_clr);
$qbinb = ser("rstr,config", $_SESSION['qdu'] . ' WHERE name="' . $node_clr . '"');
$prmb = explode('#', $qbinb["config"]);
$_SESSION['prmb'] = prmb_defaults($prmb);
$_SESSION['node_clr'] = $node_clr;
$_SESSION['rstr'] = strsplit($qbinb['rstr']);
}
示例14: strtolower
if (isset($_POST['keyring_id']) && isset($_POST['keyring_name']) && isset($_POST['keyring_password']) && isset($_POST['keyring_retyped_password'])) {
$id = strtolower($_POST['keyring_id']);
$name = $_POST['keyring_name'];
$pass = $_POST['keyring_password'];
$desc = $_POST['keyring_description'];
if (!ctype_alpha($id)) {
ser("Invalid ID", "Keyring ID should onlt contain alphabets");
} elseif (strlen($pass) < 6) {
ser("Invalid Password", "A password should have minimum characters of 6. Your's doesn't even have 6 characters.");
} elseif ($pass != $_POST['keyring_retyped_password']) {
ser("Passwords Mismatch", "The passwords you entered didn't match. Please try again.");
} else {
if ($this->MasterAdd($id, $name, $desc, $pass)) {
sss("Created KeyRing", "Your keyring was successfulyl created.");
} else {
ser("KeyRing Exists", "The keyring with the ID you gave already exists");
}
}
}
?>
<form method='POST' action='<?php
echo APP_URL;
?>
/new-master'>
<label>
<span>ID</span>
<input type='text' name='keyring_id' placeholder='A unique KeyRing ID. Lowercase ALPHABETS Only' />
</label>
<label>
<span>Name</span>
<input type='text' name='keyring_name' placeholder='KeyRing Name. Whitespaces allowed' />
示例15: ser
<?php
require_once __DIR__ . "/load.php";
$GLOBALS['workspaceHTML'] = "";
/**
* Dispatch the Routes
*/
\Lobby\Router::dispatch();
if (!isset($GLOBALS['route_active'])) {
if ($GLOBALS['workspaceHTML'] != "" || is_array($GLOBALS['workspaceHTML'])) {
require_once L_DIR . "/includes/lib/core/Inc/page.php";
} else {
ser();
}
}