本文整理汇总了PHP中module_security::logout方法的典型用法代码示例。如果您正苦于以下问题:PHP module_security::logout方法的具体用法?PHP module_security::logout怎么用?PHP module_security::logout使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类module_security
的用法示例。
在下文中一共展示了module_security::logout方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: writable
<?php
/**
* Copyright: dtbaker 2012
* Licence: Please check CodeCanyon.net for licence details.
* More licence clarification available here: http://codecanyon.net/wiki/support/legal-terms/licensing-terms/
* Deploy: 9809 f200f46c2a19bb98d112f2d32a8de0c4
* Envato: 4ffca17e-861e-4921-86c3-8931978c40ca
* Package Date: 2015-11-25 02:55:20
* IP Address: 67.79.165.254
*/
if (!_UCM_INSTALLED) {
module_security::logout();
}
$setup_errors = false;
// see if we can write to a file, ext.php or design_menu.php
if (!touch(_UCM_FOLDER . 'cron.php') || !touch(_UCM_FOLDER . 'ext.php') || !touch(_UCM_FOLDER . 'design_menu.php')) {
set_error('Sorry, the base folder <strong>' . _UCM_FOLDER . '</strong> is not writable by PHP. Please contact your hosting provider and ask for this folder to be set writable by PHP. Or change the permissions to writable (777 in most cases) using your FTP program.');
$setup_errors = true;
}
// check folder permissions and the like.
$temp_folder = _UCM_FOLDER . "temp/";
if (!is_dir($temp_folder) || !is_writable($temp_folder)) {
if ($temp_folder === false) {
// doesn't exist.
$temp_folder = '/temp/';
}
set_error('Sorry, the folder <strong>' . $temp_folder . '</strong> is not writable. Please contact your hosting provider and ask for this folder to be set writable by PHP. Or change the permissions to writable using your FTP program.');
$setup_errors = true;
}
// check folder permissions and the like.
示例2: external_hook
public function external_hook($hook)
{
switch ($hook) {
case 'public_signup_form':
$signup_form = module_template::get_template_by_key('customer_signup_form_wrapper');
$signup_form->page_title = $signup_form->description;
$signup_form->assign_values(array('signup_form' => self::get_customer_signup_form_html()));
echo $signup_form->render('pretty_html');
exit;
case 'public_signup':
// sign out if testing.
if (module_security::is_logged_in()) {
set_message('Logged out due to signup');
module_security::logout();
}
$result = array('messages' => array());
function customer_signup_complete($result)
{
if (isset($_REQUEST['via_ajax'])) {
echo json_encode($result);
} else {
echo implode('<br/>', $result['messages']);
}
exit;
}
if (!module_config::c('customer_signup_allowed', 0)) {
$result['error'] = 1;
$result['messages'][] = 'Customer signup disabled';
customer_signup_complete($result);
}
//recaptcha on signup form.
if (module_config::c('captcha_on_signup_form', 0)) {
if (!module_captcha::check_captcha_form()) {
$result['error'] = 1;
$result['messages'][] = 'Captcha fail, please go back and enter correct captcha code.';
customer_signup_complete($result);
}
}
$customer = isset($_POST['customer']) && is_array($_POST['customer']) ? $_POST['customer'] : array();
$contact = isset($_POST['contact']) && is_array($_POST['contact']) ? $_POST['contact'] : array();
$contact_extra = isset($contact['extra']) && is_array($contact['extra']) ? $contact['extra'] : array();
$contact_group = isset($contact['group_ids']) && is_array($contact['group_ids']) ? $contact['group_ids'] : array();
$customer_extra = isset($customer['extra']) ? $customer['extra'] : array();
$customer_group = isset($customer['group_ids']) && is_array($customer['group_ids']) ? $customer['group_ids'] : array();
$address = isset($_POST['address']) ? $_POST['address'] : array();
$website = isset($_POST['website']) ? $_POST['website'] : array();
$website_extra = isset($website['extra']) ? $website['extra'] : array();
$website_group = isset($website['group_ids']) && is_array($website['group_ids']) ? $website['group_ids'] : array();
$job = isset($_POST['job']) ? $_POST['job'] : array();
$job_extra = isset($job['extra']) ? $job['extra'] : array();
$subscription = isset($_POST['subscription']) ? $_POST['subscription'] : array();
// sanatise possibly problematic fields:
// customer:
$allowed = array('name', 'last_name', 'customer_name', 'email', 'phone', 'mobile', 'extra', 'type');
foreach ($customer as $key => $val) {
if (!in_array($key, $allowed)) {
unset($customer[$key]);
}
}
if (isset($customer['type']) && $customer['type'] != _CUSTOMER_TYPE_NORMAL && $customer['type'] != _CUSTOMER_TYPE_LEAD) {
unset($customer['type']);
}
// added multiple contact support in the form of arrays.
$contact_fields = array('name', 'last_name', 'email', 'phone');
if (module_config::c('customer_signup_password', 0)) {
$contact_fields[] = 'password';
}
foreach ($contact_fields as $multi_value) {
if (isset($contact[$multi_value])) {
if (!is_array($contact[$multi_value])) {
$contact[$multi_value] = array($contact[$multi_value]);
}
} else {
if (isset($customer[$multi_value])) {
$contact[$multi_value] = array($customer[$multi_value]);
} else {
$contact[$multi_value] = array();
}
}
}
$valid_contact_email = false;
$name_fallback = false;
$primary_email = false;
foreach ($contact['email'] as $contact_key => $email) {
if (!$name_fallback && isset($contact['name'][$contact_key])) {
$name_fallback = $contact['name'][$contact_key];
}
$contact['email'][$contact_key] = filter_var(strtolower(trim($email)), FILTER_VALIDATE_EMAIL);
if ($contact['email'][$contact_key]) {
$valid_contact_email = true;
if (!$primary_email) {
$primary_email = $contact['email'][$contact_key];
// set the primary contact details here by adding them to the master customer array
foreach ($contact_fields as $primary_contact_field) {
$customer[$primary_contact_field] = isset($contact[$primary_contact_field][$contact_key]) ? $contact[$primary_contact_field][$contact_key] : '';
unset($contact[$primary_contact_field][$contact_key]);
}
}
}
}
//.........这里部分代码省略.........