本文整理汇总了PHP中validate_user函数的典型用法代码示例。如果您正苦于以下问题:PHP validate_user函数的具体用法?PHP validate_user怎么用?PHP validate_user使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了validate_user函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: perform_operation
function perform_operation($op)
{
if ($op == 'login') {
validate_user($_POST["useremail"], $_POST["userpassword"]);
} else {
if ($op == 'getyaks') {
get_yaks($_POST["longitude"], $_POST["latitude"]);
} else {
if ($op == 'post_yak') {
post_yak($_POST["postedyak"], $_POST["latitude"], $_POST["longitude"]);
} else {
if ($op == 'banned_user') {
banned_user($_POST["useremail"]);
} else {
if ($op == 'add_user') {
add_user($_POST["useremail"], $_POST["userpassword"]);
} else {
if ($op == 'send_email') {
send_email($_POST["email"]);
} else {
if ($op == 'getHot_yaks') {
getHot_yaks();
} else {
if ($op == 'getCold_yaks') {
getCold_yaks();
} else {
if ($op == 'upvote') {
upvote($_POST["id"]);
} else {
if ($op == 'downvote') {
downvote($_POST["id"]);
}
}
}
}
}
}
}
}
}
}
}
示例2: validate_user
// | Copyright(c) 2008-2014 PhreeSoft (www.PhreeSoft.com) |
// +-----------------------------------------------------------------+
// | This program is free software: you can redistribute it and/or |
// | modify it under the terms of the GNU General Public License as |
// | published by the Free Software Foundation, either version 3 of |
// | the License, or any later version. |
// | |
// | This program is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
// | GNU General Public License for more details. |
// +-----------------------------------------------------------------+
// Path: /modules/xml_builder/pages/main/pre_process.php
//
// This script updates the xml module information file
$security_level = validate_user(SECURITY_ID_XML_BUILDER);
/************** include page specific files *********************/
require_once DIR_FS_WORKING . 'classes/xml_builder.php';
require_once DIR_FS_MODULES . 'phreedom/classes/backup.php';
/************** page specific initialization *************************/
$working = new xml_builder();
$mod_xml = new backup();
/*************** Act on the action request *************************/
switch ($_REQUEST['action']) {
case 'save':
validate_security($security_level, 2);
// read the input variables
$mod = $_POST['mod'];
$mod_admin = $mod . '_admin';
require_once DIR_FS_MODULES . $mod . '/classes/install.php';
$mod_info = new $mod_admin();
示例3: __construct
public function __construct()
{
parent::__construct();
//user must be logged in to access any methods of this class
validate_user($this->session->userdata);
}
示例4: validate_user
// +-----------------------------------------------------------------+
// | Copyright(c) 2008-2014 PhreeSoft (www.PhreeSoft.com) |
// +-----------------------------------------------------------------+
// | This program is free software: you can redistribute it and/or |
// | modify it under the terms of the GNU General Public License as |
// | published by the Free Software Foundation, either version 3 of |
// | the License, or any later version. |
// | |
// | This program is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
// | GNU General Public License for more details. |
// +-----------------------------------------------------------------+
// Path: /modules/phreepos/ajax/other_transactions.php
//
$security_level = validate_user(SECURITY_ID_PHREEPOS);
define('JOURNAL_ID', 2);
/************** include page specific files *********************/
gen_pull_language('contacts');
gen_pull_language('phreebooks');
gen_pull_language('inventory');
gen_pull_language('phreeform');
require_once DIR_FS_MODULES . 'inventory/defaults.php';
require_once DIR_FS_MODULES . 'phreeform/defaults.php';
require_once DIR_FS_MODULES . 'phreebooks/functions/phreebooks.php';
require_once DIR_FS_MODULES . 'phreebooks/classes/gen_ledger.php';
require_once DIR_FS_MODULES . 'phreepos/classes/tills.php';
require_once DIR_FS_MODULES . 'phreepos/classes/other_transactions.php';
/************** page specific initialization *************************/
define('ORD_ACCT_ID', GEN_CUSTOMER_ID);
define('GL_TYPE', 'sos');
示例5: search
function search($user_name, $password, $name)
{
if (!validate_user($user_name, $password)) {
return array();
}
$name_list = explode("; ", $name);
$list = array();
foreach ($name_list as $single_name) {
$list = array_merge($list, contact_by_search($single_name));
$list = array_merge($list, lead_by_search($single_name));
$list = array_merge($list, account_by_search($single_name));
$list = array_merge($list, case_by_search($single_name));
$list = array_merge($list, opportunity_by_search($single_name));
$list = array_merge($list, bug_by_search($single_name));
}
return $list;
}
示例6: validate_user
// +-----------------------------------------------------------------+
// | Copyright(c) 2008-2014 PhreeSoft (www.PhreeSoft.com) |
// +-----------------------------------------------------------------+
// | This program is free software: you can redistribute it and/or |
// | modify it under the terms of the GNU General Public License as |
// | published by the Free Software Foundation, either version 3 of |
// | the License, or any later version. |
// | |
// | This program is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
// | GNU General Public License for more details. |
// +-----------------------------------------------------------------+
// Path: /modules/phreedom/pages/encryption/pre_process.php
//
$security_level = validate_user(SECURITY_ID_ENCRYPTION);
/************** include page specific files *********************/
gen_pull_language($module, 'admin');
/************** page specific initialization *************************/
$error = false;
/*************** hook for custom actions ***************************/
$custom_path = DIR_FS_WORKING . 'custom/pages/encryption/extra_actions.php';
if (file_exists($custom_path)) {
include $custom_path;
}
/*************** Act on the action request *************************/
switch ($_REQUEST['action']) {
case 'save':
$enc_key = db_prepare_input($_POST['enc_key']);
$enc_key_confirm = db_prepare_input($_POST['enc_key_confirm']);
if ($enc_key != $enc_key_confirm) {
示例7: validate_user
// +-----------------------------------------------------------------+
// | Copyright(c) 2008-2014 PhreeSoft (www.PhreeSoft.com) |
// +-----------------------------------------------------------------+
// | This program is free software: you can redistribute it and/or |
// | modify it under the terms of the GNU General Public License as |
// | published by the Free Software Foundation, either version 3 of |
// | the License, or any later version. |
// | |
// | This program is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
// | GNU General Public License for more details. |
// +-----------------------------------------------------------------+
// Path: /modules/phreeform/pages/admin/pre_process.php
//
$security_level = validate_user(SECURITY_ID_CONFIGURATION);
/************** include page specific files *********************/
gen_pull_language($module, 'admin');
gen_pull_language('phreedom', 'admin');
require_once DIR_FS_WORKING . 'defaults.php';
require_once DIR_FS_WORKING . 'functions/phreeform.php';
require_once DIR_FS_MODULES . 'phreedom/functions/phreedom.php';
require_once DIR_FS_WORKING . 'classes/install.php';
/************** page specific initialization *************************/
$error = false;
$install = new phreeform_admin();
/*************** Act on the action request *************************/
switch ($_REQUEST['action']) {
case 'save':
validate_security($security_level, 3);
// save general tab
示例8: validate_user
<?php
///////////////////////////////////////////////////////////////////////////////////////
// PHPmotion http://www.phpmotion.com //
///////////////////////////////////////////////////////////////////////////////////////
// License: You are not to sell or distribute this software without permission //
// Help and support please visit http://www.phpmotion.com //
// Copyright reserved //
///////////////////////////////////////////////////////////////////////////////////////
validate_user($_COOKIE['user']);
// set user vars for passing around each php page
$user_id = $_SESSION['user_id'];
$user_name = $_SESSION['user_name'];
$user_group = $_SESSION['user_group'];
if ($user_id != '') {
$sql = "SELECT * FROM member_profile WHERE user_id = '{$user_id}'";
$query = @mysql_query($sql);
$outcome = @mysql_fetch_array($query);
$result = $outcome['account_status'];
if ($result == 'suspended') {
$user_id = '';
$user_name = '';
$_SESSION['user_id'] = NULL;
$_SESSION['user_name'] = NULL;
$_SESSION['user_group'] = NULL;
@session_start();
@session_destroy();
foreach ($_COOKIE as $key => $value) {
$logout = '';
setcookie($key, $logout);
}
示例9: validate_user
// +-----------------------------------------------------------------+
// | Copyright(c) 2008-2014 PhreeSoft (www.PhreeSoft.com) |
// +-----------------------------------------------------------------+
// | This program is free software: you can redistribute it and/or |
// | modify it under the terms of the GNU General Public License as |
// | published by the Free Software Foundation, either version 3 of |
// | the License, or any later version. |
// | |
// | This program is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
// | GNU General Public License for more details. |
// +-----------------------------------------------------------------+
// Path: /modules/work_orders/pages/builder/pre_process.php
//
$security_level = validate_user(SECURITY_WORK_ORDERS_BUILDER);
/************** include page specific files *********************/
require_once DIR_FS_MODULES . 'inventory/defaults.php';
/************** page specific initialization *************************/
$error = false;
$processed = false;
$lock_title = false;
$hide_save = false;
$criteria = array();
history_filter('wo_build');
// load the filters
$f0 = $_GET['f0'] = isset($_POST['action']) ? isset($_POST['f0']) ? '1' : '0' : $_GET['f0'];
// show inactive checkbox
/*************** hook for custom actions ***************************/
$custom_path = DIR_FS_WORKING . 'custom/pages/builder/extra_actions.php';
if (file_exists($custom_path)) {
示例10: filter_xss
*
*/
exit;
//Uncomment this to execute the page
//After you located this file in you new domain and you set the settings in step 2,
//this page will be loaded when entering to the Chamilo site if the SSO option was set in step 1.
//Getting the chamilo server
$my_chamilo_server = filter_xss($_SERVER['HTTP_HOST']);
$account = array();
if (isset($_SESSION['my_server_user_session'])) {
//validate if the user is already logged in my external system in order to redirect to chamilo
}
//Login process
if (isset($_POST['user']) && isset($_POST['password'])) {
//1. Your Server validations
$validate = validate_user($_POST['user'], $_POST['password']);
if ($validate) {
/* 2.Get the chamilo username and password from your system or from webservices */
$account['username'] = 'jbrion525';
//username in Chamilo
$account['password'] = sha1(sha1('jbrion525'));
//encrypted password with assuming that the first encrypted method is sha1 in chamilo
$master_auth_uri = $my_chamilo_server . '/?q=user';
// Creating an array cookie that will be sent to Chamilo
$sso = array('username' => $account['username'], 'secret' => $account['password'], 'master_domain' => $my_chamilo_server, 'master_auth_uri' => $master_auth_uri, 'lifetime' => time() + 3600, 'target' => filter_xss($_GET['sso_target']));
$cookie = base64_encode(serialize($sso));
$url = chamilo_sso_protocol() . $master_auth_uri;
$params = 'sso_referer=' . urlencode($url) . '&sso_cookie=' . urlencode($cookie);
$final_url = filter_xss($_GET['sso_referer']) . '?' . $params;
//If your user exists redirect to chamilo and set the account in a session to check it later
$_SESSION['my_server_user_session'] = $account;
示例11: header
<?php
// txt-db-api library: http://www.c-worker.ch/txtdbapi/index_eng.php
require_once "php-txt-db/txt-db-api.php";
require_once "login.php";
require_once "auth.php";
require_once "navigation.php";
// Allow users to use the back button without re-posting data
header("Cache-Control: private");
// Bypass Chrome's XSS check/block
header("X-XSS-Protection: 0");
// Init global variables
$db = new Database("pancoin");
$user = new User($db);
// Check for logout and maybe display login page
if ($_GET['action'] == 'logout') {
$user->_logout();
display_login();
exit;
}
// Validate user and maybe display login page
if (!validate_user($user)) {
display_login();
exit;
}
示例12: validate_device
return 0;
}
}
function validate_device($device, $valid_devices)
{
if (in_array($device, $valid_devices)) {
return 1;
} else {
return 0;
}
}
$user = get_value($_SERVER, 'PHP_AUTH_USER');
$pass = get_value($_SERVER, 'PHP_AUTH_PW');
$device = get_value($_POST, 'device');
$action = get_value($_POST, 'trigger');
$data = get_data($data_file);
if (validate_device($device, $valid_devices)) {
if (validate_user($user, $pass, $valid_passwords, $ignore_auth_for_devices)) {
$entry = array('action' => $action, 'time' => time());
$data[$device] = $entry;
dump_data($data, $data_file);
header('HTTP/1.0 200');
die;
}
}
if (validate_user($user, $pass, $valid_passwords, 0)) {
echo json_encode($data);
} else {
header('HTTP/1.0 403 Forbidden');
die("Not authorized");
}
示例13: validate_user
// +-----------------------------------------------------------------+
// | Copyright(c) 2008-2014 PhreeSoft (www.PhreeSoft.com) |
// +-----------------------------------------------------------------+
// | This program is free software: you can redistribute it and/or |
// | modify it under the terms of the GNU General Public License as |
// | published by the Free Software Foundation, either version 3 of |
// | the License, or any later version. |
// | |
// | This program is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
// | GNU General Public License for more details. |
// +-----------------------------------------------------------------+
// Path: /modules/phreepos/pages/pos_mgr/pre_process.php
//
$security_level = validate_user(SECURITY_ID_POS_MGR);
define('JOURNAL_ID', '19');
/************** include page specific files *********************/
require_once DIR_FS_MODULES . 'phreebooks/classes/gen_ledger.php';
if (file_exists(DIR_FS_MODULES . 'phreepos/custom/classes/journal/journal_' . JOURNAL_ID . '.php')) {
require_once DIR_FS_MODULES . 'phreepos/custom/classes/journal/journal_' . JOURNAL_ID . '.php';
} else {
require_once DIR_FS_MODULES . 'phreepos/classes/journal/journal_' . JOURNAL_ID . '.php';
// is needed here for the defining of the class and retriving the security_token
}
$class = 'journal_' . JOURNAL_ID;
/************** page specific initialization *************************/
define('POPUP_FORM_TYPE', 'pos:rcpt');
$error = false;
history_filter('pos_mgr');
/*************** hook for custom actions ***************************/
示例14: validate_user
// +-----------------------------------------------------------------+
// | Copyright(c) 2008-2014 PhreeSoft (www.PhreeSoft.com) |
// +-----------------------------------------------------------------+
// | This program is free software: you can redistribute it and/or |
// | modify it under the terms of the GNU General Public License as |
// | published by the Free Software Foundation, either version 3 of |
// | the License, or any later version. |
// | |
// | This program is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
// | GNU General Public License for more details. |
// +-----------------------------------------------------------------+
// Path: /modules/inventory/pages/price_sheets/pre_process.php
//
$security_level = validate_user(SECURITY_ID_PRICE_SHEET_MANAGER);
/************** include page specific files *********************/
require_once DIR_FS_WORKING . 'defaults.php';
/************** page specific initialization *************************/
$type = isset($_GET['type']) ? $_GET['type'] : 'c';
history_filter('inv_prices');
/*************** hook for custom actions ***************************/
$custom_path = DIR_FS_MODULES . 'inventory/pages/price_sheets/extra_actions.php';
if (file_exists($custom_path)) {
include $custom_path;
}
/*************** Act on the action request *************************/
switch ($_REQUEST['action']) {
case 'save':
case 'update':
validate_security($security_level, 2);
示例15: validate_user
// +-----------------------------------------------------------------+
// | Copyright(c) 2008-2014 PhreeSoft, LLC (www.PhreeSoft.com) |
// +-----------------------------------------------------------------+
// | This program is free software: you can redistribute it and/or |
// | modify it under the terms of the GNU General Public License as |
// | published by the Free Software Foundation, either version 3 of |
// | the License, or any later version. |
// | |
// | This program is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
// | GNU General Public License for more details. |
// +-----------------------------------------------------------------+
// Path: /modules/phreebooks/pages/admin_tools/pre_process.php
//
$security_level = validate_user(SECURITY_ID_GEN_ADMIN_TOOLS);
/************** include page specific files *********************/
gen_pull_language($module, 'admin');
require DIR_FS_WORKING . 'functions/phreebooks.php';
require DIR_FS_WORKING . 'classes/gen_ledger.php';
/************** page specific initialization *************************/
define('JOURNAL_ID', 2);
// General Journal
if (!defined('CURRENT_ACCOUNTING_PERIOD')) {
gen_auto_update_period(false);
}
$error = false;
$start_date = $_POST['start_date'] ? gen_db_date($_POST['start_date']) : CURRENT_ACCOUNTING_PERIOD_START;
$end_date = $_POST['end_date'] ? gen_db_date($_POST['end_date']) : CURRENT_ACCOUNTING_PERIOD_END;
// see what fiscal year we are looking at (assume this FY is entered for the first time)
if ($_POST['fy']) {