本文整理汇总了PHP中my_getenv函数的典型用法代码示例。如果您正苦于以下问题:PHP my_getenv函数的具体用法?PHP my_getenv怎么用?PHP my_getenv使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了my_getenv函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ajax__inlineLogInForm
function ajax__inlineLogInForm()
{
$IPBHTML = "";
if (IPSLib::locationHasHooks('skin_login', $this->_funcHooks['ajax__inlineLogInForm'])) {
$count_1c5592ad5da07344e7b7c6fb15cb30f1 = is_array($this->functionData['ajax__inlineLogInForm']) ? count($this->functionData['ajax__inlineLogInForm']) : 0;
}
$uses_name = false;
$uses_email = false;
$_redirect = '';
foreach ($this->cache->getCache('login_methods') as $method) {
if ($method['login_user_id'] == 'username' or $method['login_user_id'] == 'either') {
$uses_name = true;
}
if ($method['login_user_id'] == 'email' or $method['login_user_id'] == 'either') {
$uses_email = true;
}
if ($method['login_login_url']) {
$_redirect = $method['login_login_url'];
}
}
if ($uses_name and $uses_email) {
$this->lang->words['enter_name'] = $this->lang->words['enter_name_and_email'];
} else {
if ($uses_email) {
$this->lang->words['enter_name'] = $this->lang->words['enter_useremail'];
} else {
$this->lang->words['enter_name'] = $this->lang->words['enter_username'];
}
}
$IPBHTML .= "" . ($_redirect ? "\r\n<script type='text/javascript'>\r\nwindow.location = '{$_redirect}';\r\n</script>\r\n" : "<div id='inline_login_form'>\r\n\t<form action=\"" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=core&module=global&section=login&do=process", "public", ''), "", "") . "\" method=\"post\" id='login'>\r\n\t\t<input type='hidden' name='auth_key' value='{$this->member->form_hash}' />\r\n\t\t<input type=\"hidden\" name=\"referer\" value=\"" . str_replace(array('<', '>', '(', ')'), '-', my_getenv('HTTP_REFERER')) . "\" />\r\n\t\t<h3>{$this->lang->words['log_in']}</h3>\r\n\t\t" . (IPSLib::loginMethod_enabled('facebook') || IPSLib::loginMethod_enabled('twitter') || IPSLib::loginMethod_enabled('live') ? "<div class='ipsBox_notice'>\r\n\t\t\t\t<ul class='ipsList_inline'>\r\n\t\t\t\t\t" . (IPSLib::loginMethod_enabled('facebook') ? "\r\n\t\t\t\t\t\t<li><a href=\"" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=core&module=global&section=login&serviceClick=facebook", "public", ''), "", "") . "\"><img src=\"{$this->settings['img_url']}/facebook_login.png\" alt=\"\" /></a></li>\r\n\t\t\t\t\t" : "") . "\r\n\t\t\t\t\t" . (IPSLib::loginMethod_enabled('twitter') ? "\r\n\t\t\t\t\t\t<li><a href=\"" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=core&module=global&section=login&serviceClick=twitter", "public", ''), "", "") . "\"><img src=\"{$this->settings['img_url']}/twitter_login.png\" alt=\"\" /></a></li>\r\n\t\t\t\t\t" : "") . "\r\n\t\t\t\t\t" . (IPSLib::loginMethod_enabled('live') ? "\r\n\t\t\t\t\t\t<li><a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=core&module=global&section=login&do=process&use_live=1&auth_key={$this->member->form_hash}", "public", ''), "", "") . "' title='{$this->lang->words['use_live']}'>" . $this->registry->getClass('output')->getReplacement("live_small") . " {$this->lang->words['sign_in_winlive']}</a></li>\r\n\t\t\t\t\t" : "") . "\r\n\t\t\t\t</ul>\r\n\t\t\t</div>" : "") . "\r\n\t\t<br />\r\n\t\t<div class='ipsForm ipsForm_horizontal'>\r\n\t\t\t<fieldset>\r\n\t\t\t\t<ul>\r\n\t\t\t\t\t<li class='ipsField'>\r\n\t\t\t\t\t\t<div class='ipsField_content'>\r\n\t\t\t\t\t\t\t{$this->lang->words['register_prompt_1']} <a href=\"" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=core&module=global&section=register", "public", ''), "", "") . "\" title='{$this->lang->words['register_prompt_2']}'>{$this->lang->words['register_prompt_2']}</a>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</li>\r\n\t\t\t\t\t<li class='ipsField ipsField_primary'>\r\n\t\t\t\t\t\t<label for='ips_username' class='ipsField_title'>{$this->lang->words['enter_name']}</label>\r\n\t\t\t\t\t\t<div class='ipsField_content'>\r\n\t\t\t\t\t\t\t<input id='ips_username' type='text' class='input_text' name='ips_username' size='30' />\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</li>\r\n\t\t\t\t\t<li class='ipsField ipsField_primary'>\r\n\t\t\t\t\t\t<label for='ips_password' class='ipsField_title'>{$this->lang->words['enter_pass']}</label>\r\n\t\t\t\t\t\t<div class='ipsField_content'>\r\n\t\t\t\t\t\t\t<input id='ips_password' type='password' class='input_text' name='ips_password' size='30' /><br />\r\n\t\t\t\t\t\t\t<a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=core&module=global&section=lostpass", "public", ''), "", "") . "' title='{$this->lang->words['retrieve_pw']}'>{$this->lang->words['login_forgotten_pass']}</a>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</li>\r\n\t\t\t\t\t<li class='ipsField ipsField_checkbox'>\r\n\t\t\t\t\t\t<input type='checkbox' id='inline_remember' checked='checked' name='rememberMe' value='1' class='input_check' />\r\n\t\t\t\t\t\t<div class='ipsField_content'>\r\n\t\t\t\t\t\t\t<label for='inline_remember'>\r\n\t\t\t\t\t\t\t\t<strong>{$this->lang->words['rememberme']}</strong><br />\r\n\t\t\t\t\t\t\t\t<span class='desc lighter'>{$this->lang->words['notrecommended']}</span>\r\n\t\t\t\t\t\t\t</label>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</li>\r\n\t\t\t\t\t" . (!$this->settings['disable_anonymous'] ? "\r\n\t\t\t\t\t\t<li class='ipsField ipsField_checkbox'>\r\n\t\t\t\t\t\t\t<input type='checkbox' id='inline_invisible' name='anonymous' value='1' class='input_check' />\r\n\t\t\t\t\t\t\t<div class='ipsField_content'>\r\n\t\t\t\t\t\t\t\t<label for='inline_invisible'>\r\n\t\t\t\t\t\t\t\t\t<strong>{$this->lang->words['form_invisible']}</strong><br />\r\n\t\t\t\t\t\t\t\t\t<span class='desc lighter'>{$this->lang->words['anon_name']}</span>\r\n\t\t\t\t\t\t\t\t</label>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t</li>\r\n\t\t\t\t\t" : "") . "\r\n\t\t\t\t</ul>\r\n\t\t\t</fieldset>\r\n\t\t\t<div class='ipsForm_submit ipsForm_center'>\r\n\t\t\t\t<input type='submit' class='ipsButton' value='{$this->lang->words['log_in']}' />\r\n\t\t\t</div>\r\n\t\t</div>\r\n\t</form>\r\n</div>") . "";
return $IPBHTML;
}
示例2: cdmoin
function cdmoin(&$prev, $fd)
{
if (!isset($prev)) {
$prev = my_getenv("PWD");
}
chdir($prev);
$temp = my_getenv("PWD");
majenv("PWD", $prev);
$prev = $temp;
majenv("OLDPWD", $temp);
func_pwd("incase", $fd);
}
示例3: createAdminAccount
/**
* Create admin account
*
* @access public
* @return @e void
*/
public static function createAdminAccount()
{
/* Build Entry */
$_mke_time = ipsRegistry::$settings['login_key_expire'] ? time() + intval(ipsRegistry::$settings['login_key_expire']) * 86400 : 0;
$salt = IPSMember::generatePasswordSalt(5);
$passhash = IPSMember::generateCompiledPasshash($salt, md5(IPSSetUp::getSavedData('admin_pass')));
$_dname = IPSSetUp::getSavedData('admin_user');
$member = array('name' => $_dname, 'members_l_username' => strtolower($_dname), 'members_display_name' => $_dname, 'members_l_display_name' => strtolower($_dname), 'members_seo_name' => IPSText::makeSeoTitle($_dname), 'member_login_key' => IPSMember::generateAutoLoginKey(), 'member_login_key_expire' => $_mke_time, 'title' => 'Administrator', 'email' => IPSSetUp::getSavedData('admin_email'), 'member_group_id' => 4, 'posts' => 1, 'joined' => time(), 'last_visit' => time(), 'last_activity' => time(), 'ip_address' => my_getenv('REMOTE_ADDR'), 'view_sigs' => 1, 'restrict_post' => 0, 'msg_show_notification' => 1, 'msg_count_total' => 0, 'msg_count_new' => 0, 'coppa_user' => 0, 'language' => IPSLib::getDefaultLanguage(), 'members_auto_dst' => 1, 'member_uploader' => 'flash', 'allow_admin_mails' => 0, 'members_pass_hash' => $passhash, 'members_pass_salt' => $salt, 'has_blog' => '', 'fb_token' => '', 'ignored_users' => '', 'members_cache' => '', 'failed_logins' => '', 'bday_day' => 0, 'bday_month' => 0, 'bday_year' => 0);
/* Insert: MEMBERS */
ipsRegistry::DB()->setDataType(array('name', 'members_display_name', 'members_l_username', 'members_l_display_name'), 'string');
ipsRegistry::DB()->insert('members', $member);
$member_id = ipsRegistry::DB()->getInsertId();
$member['member_id'] = $member_id;
/* Insert into the custom profile fields DB */
ipsRegistry::DB()->insert('pfields_content', array('member_id' => $member_id));
/* Insert into pp */
ipsRegistry::DB()->insert('profile_portal', array('pp_member_id' => $member_id, 'pp_setting_count_friends' => 1, 'signature' => '', 'pconversation_filters' => '', 'pp_setting_count_comments' => 1, 'pp_setting_count_visitors' => 1));
}
示例4: __construct
/**
* Method constructor
*
* @access public
* @param object Registry Object
* @return void
*/
public function __construct(ipsRegistry $registry)
{
parent::__construct($registry);
/* Are we tracing this user? */
list($_groups, $_ids) = explode('&', trim(IPS_TOPICMARKERS_TRACE));
/* Groups */
list($_t, $groups) = explode('=', trim($_groups));
list($_t, $ids) = explode('=', trim($_ids));
if ($groups) {
foreach (explode(',', $groups) as $gid) {
if ($this->memberData['member_group_id'] == $gid) {
$this->TRACE = TRUE;
break;
}
}
}
if ($ids and !$this->TRACE) {
foreach (explode(',', $ids) as $id) {
if ($this->memberData['member_id'] == trim($id)) {
$this->TRACE = TRUE;
break;
}
}
}
/* Create session key */
$this->SESSION_KEY = md5(uniqid(microtime() . 'tms', true));
/* Create URL */
$this->URL = my_getenv('HTTP_HOST') . my_getenv('REQUEST_URI');
/* Got a table? */
//$this->DB->dropTable( 'core_topicmarker_debug' );
if (!$this->DB->checkForTable('core_topicmarker_debug')) {
$prefix = $this->registry->dbFunctions()->getPrefix();
$this->DB->query("CREATE TABLE " . $prefix . "core_topicmarker_debug (\n\t\t\t\t\t\t\t\tmarker_member_id\tINT(10) NOT NULL default 0,\n\t\t\t\t\t\t\t\tmarker_session_key\tVARCHAR(32) NOT NULL default '',\n\t\t\t\t\t\t\t\tmarker_message\t\tVARCHAR(255) NOT NULL default '',\n\t\t\t\t\t\t\t\tmarker_data_freezer\tMEDIUMTEXT,\n\t\t\t\t\t\t\t\tmarker_data_storage\tMEDIUMTEXT,\n\t\t\t\t\t\t\t\tmarker_data_memory MEDIUMTEXT,\n\t\t\t\t\t\t\t\tmarker_timestamp\tINT(10) NOT NULL default 0,\n\t\t\t\t\t\t\t\tmarker_microtime\tVARCHAR(200) NOT NULL default '0',\n\t\t\t\t\t\t\t\tmarker_url\t\t\tTEXT,\n\t\t\t\t\t\t\t\tmarker_data_1\t\tTEXT,\n\t\t\t\t\t\t\t\tmarker_data_2\t\tTEXT,\n\t\t\t\t\t\t\t\tmarker_data_3\t\tTEXT,\n\t\t\t\t\t\t\t\tmarker_data_4\t\tTEXT,\n\t\t\t\t\t\t\t\tmarker_data_5\t\tTEXT,\n\t\t\t\t\t\t\t\tKEY marker_member_id (marker_member_id),\n\t\t\t\t\t\t\t\tKEY marker_microtime (marker_microtime),\n\t\t\t\t\t\t\t\tKEY marker_session_key (marker_session_key),\n\t\t\t\t\t\t\t\tKEY marker_timestamp (marker_timestamp ) )");
}
/* Kick start the session off */
$this->_addEntry('Marker session INIT done');
}
示例5: displayError
/**
* Display error
*
* @access public
* @param string Error message
* @param integer Error code
* @return mixed You can print a custom message here, or return formatted data to be sent do registry->output->sendOutput
*/
public function displayError($message, $code = 0)
{
list($em_1, $em_2) = explode('@', $this->settings['email_in']);
//-----------------------------------------
// If we're a guest, show the log in box..
//-----------------------------------------
if (!$this->memberData['member_id']) {
$safe_string = $this->settings['base_url'] . str_replace('&', '&', IPSText::parseCleanValue(my_getenv('QUERY_STRING')));
$has_openid = false;
$uses_name = false;
$uses_email = false;
$this->registry->getClass('class_localization')->loadLanguageFile(array('public_login'), 'core');
foreach ($this->cache->getCache('login_methods') as $method) {
if ($method['login_folder_name'] == 'openid') {
$has_openid = true;
}
if ($method['login_user_id'] == 'username') {
$uses_name = true;
}
if ($method['login_user_id'] == 'email') {
$uses_email = true;
}
}
if ($uses_name and $uses_email) {
$this->lang->words['enter_name'] = $this->lang->words['enter_name_and_email'];
} else {
if ($uses_email) {
$this->lang->words['enter_name'] = $this->lang->words['enter_useremail'];
} else {
$this->lang->words['enter_name'] = $this->lang->words['enter_username'];
}
}
$login_thing = $this->registry->getClass('output')->getTemplate('global_other')->error_log_in(str_replace('&', '&', $safe_string));
}
//-----------------------------------------
// Do we have any post data to keepy?
//-----------------------------------------
// Why even bother checking action? If they posted something and we're here, let 'em save it!
//if ( $this->request['act'] == 'post' OR $this->request['module'] == 'messenging' OR $this->request['act'] == 'calendar' )
//{
if ($_POST['Post']) {
$post_thing = $this->registry->getClass('output')->getTemplate('global_other')->error_post_textarea(IPSText::htmlspecialchars(IPSText::stripslashes($_POST['Post'])));
}
//}
//-----------------------------------------
// Show error
//-----------------------------------------
$html = $this->registry->getClass('output')->getTemplate('global_other')->Error($message, $code, $em_1, $em_2, 1, $login_thing, $post_thing);
return $html;
}
示例6: addToModLog
/**
* Adds the action to the moderator logs
*
* @param string $title
* @param string $topic_title
* @return @e void
*/
protected function addToModLog($title = 'unknown', $topic_title)
{
$this->DB->insert('moderator_logs', array('forum_id' => $this->request['f'], 'topic_id' => $this->request['t'], 'post_id' => $this->request['p'], 'member_id' => $this->getAuthor('member_id'), 'member_name' => $this->getAuthor('members_display_name'), 'ip_address' => $this->member->ip_address, 'http_referer' => htmlspecialchars(my_getenv('HTTP_REFERER')), 'ctime' => IPS_UNIX_TIME_NOW, 'topic_title' => $topic_title, 'action' => $title, 'query_string' => htmlspecialchars(my_getenv('QUERY_STRING'))));
}
示例7: _fetch_os
/**
* Fetches the user's operating system
*
* @return string
*/
protected static function _fetch_os()
{
$useragent = strtolower(my_getenv('HTTP_USER_AGENT'));
if (strstr($useragent, 'mac')) {
return 'mac';
}
if (preg_match('#wi(n|n32|ndows)#', $useragent)) {
return 'windows';
}
return 'unknown';
}
示例8: __construct
//.........这里部分代码省略.........
$this->_createGuestSession();
/**
* If we have an SSO object, run it for the create guest call
*/
if (is_object($this->sso) and method_exists($this->sso, 'checkSSOForGuest')) {
$this->sso->checkSSOForGuest('create');
}
} else {
if (self::$data_store['member_login_key'] == $cookie['pass_hash']) {
//-----------------------------------------
// Key expired?
//-----------------------------------------
if ($this->settings['login_key_expire']) {
$_sticky = 0;
$_days = $this->settings['login_key_expire'];
if (time() > self::$data_store['member_login_key_expire']) {
$_ok = 0;
}
}
if ($_ok == 1) {
$this->_createMemberSession();
/**
* If we have an SSO object, run it for the create member call
*/
if (is_object($this->sso) and method_exists($this->sso, 'checkSSOForMember')) {
$this->sso->checkSSOForMember('create');
}
//-----------------------------------------
// Change the log in key to make each authentication
// use a unique token. This means that if a cookie is
// stolen, the hacker can only use the auth once.
//-----------------------------------------
if ($this->settings['login_change_key']) {
self::$data_store['member_login_key'] = IPSMember::generateAutoLoginKey();
IPSMember::save(self::$data_store['member_id'], array('core' => array('member_login_key' => self::$data_store['member_login_key'], 'member_login_key_expire' => $_time)));
IPSCookie::set("pass_hash", self::$data_store['member_login_key'], $_sticky, $_days);
}
} else {
self::setMember(0);
$this->_createGuestSession();
/**
* If we have an SSO object, run it for the create guest call
*/
if (is_object($this->sso) and method_exists($this->sso, 'checkSSOForGuest')) {
$this->sso->checkSSOForGuest('create');
}
}
} else {
self::setMember(0);
$this->_createGuestSession();
/**
* If we have an SSO object, run it for the create guest call
*/
if (is_object($this->sso) and method_exists($this->sso, 'checkSSOForGuest')) {
$this->sso->checkSSOForGuest('create');
}
}
}
} else {
$this->_createGuestSession();
/**
* If we have an SSO object, run it for the create guest call
*/
if (is_object($this->sso) and method_exists($this->sso, 'checkSSOForGuest')) {
$this->sso->checkSSOForGuest('create');
}
}
}
//-----------------------------------------
// Knock out Google Web Accelerator
//-----------------------------------------
if (ipsRegistry::$settings['disable_prefetching']) {
if (my_getenv('HTTP_X_MOZ') and strstr(strtolower(my_getenv('HTTP_X_MOZ')), 'prefetch') and self::$data_store['member_id']) {
if (IPB_PHP_SAPI == 'cgi-fcgi' or IPB_PHP_SAPI == 'cgi') {
@header('Status: 403 Forbidden');
} else {
@header('HTTP/1.1 403 Forbidden');
}
@header("Cache-Control: no-cache, must-revalidate, max-age=0");
@header("Expires: 0");
@header("Pragma: no-cache");
print "Prefetching or precaching is not allowed. If you have Google Accelerator enabled, please disable";
exit;
}
}
//-----------------------------------------
// Still no member id and not a bot?
//-----------------------------------------
if (!self::$data_store['member_id'] and !$this->_member->is_not_human) {
self::setMember(0);
self::$data_store['last_activity'] = time();
$this->request['last_visit'] = time();
}
//-----------------------------------------
// Set a session ID cookie
//-----------------------------------------
$this->_member->session_type = $this->session_type;
$this->_member->session_id = $this->session_id;
IPSCookie::set("session_id", $this->session_id, -1);
}
示例9: appendTaskLog
/**
* Add to the log file
*
* @access public
* @param array Task data
* @param string Description to add to the log file
* @return @e void
*/
public function appendTaskLog($task, $desc)
{
if (!$task['task_log']) {
return;
}
$save = array('log_title' => $task['task_title'], 'log_date' => time(), 'log_ip' => my_getenv('REMOTE_ADDR'), 'log_desc' => $desc);
$this->DB->insert('task_logs', $save);
}
示例10: _revertSettings
/**
* Revert a setting to the default value
*
* @return @e void
*/
protected function _revertSettings()
{
$this->request['id'] = intval($this->request['id']);
if (!$this->request['id']) {
$this->registry->output->global_message = $this->lang->words['s_noid'];
$this->_settingForm();
return;
}
$conf = $this->DB->buildAndFetch(array('select' => '*', 'from' => 'core_sys_conf_settings', 'where' => 'conf_id=' . $this->request['id']));
//--------------------------------------------
// Revert...
//--------------------------------------------
IPSLib::updateSettings(array($conf['conf_key'] => $conf['conf_default']));
$this->registry->output->global_message = $this->lang->words['s_revertedback'];
$this->settingsRebuildCache();
//-----------------------------------------
// Boink
//-----------------------------------------
$referrer = my_getenv('HTTP_REFERER');
if (strstr($referrer, $this->settings['_admin_link']) and !strstr($referrer, 'app=core&module=settings§ion=settings')) {
$this->registry->output->silentRedirect($referrer);
return;
} else {
$this->_viewSettings();
}
}
示例11: _buildSubMenu
//.........这里部分代码省略.........
foreach ($fakeApps as $_app => $_fdata) {
foreach ($_fdata as $__fdata) {
/* If the fake app matches the menu we're gonna show... */
if ($__fdata['app'] == $app_dir and $__fdata['module'] == $_current_module) {
if ($inFakeApp === TRUE && $_app == $fakeApp) {
$skip = FALSE;
}
} else {
/* If we're in a fake app, skip non fake apps */
if ($inFakeApp !== TRUE) {
$skip = FALSE;
}
}
}
}
if ($skip === TRUE) {
continue;
}
if ($app_dir == ipsRegistry::$request['app'] and !stristr($this->settings['query_string_safe'], 'module=')) {
$this->settings['query_string_safe'] = $this->settings['query_string_safe'] . '&module=' . $clean_module;
}
foreach ($module_data['items'] as $id => $item) {
//-----------------------------------------
// Permission mask?
//-----------------------------------------
if ($item['rolekey']) {
ipsRegistry::getClass('class_permissions')->return = 1;
if (ipsRegistry::getClass('class_permissions')->checkPermission($item['rolekey'], $app_dir, $_current_module) !== TRUE) {
//print '<pre>';print $app_dir . ' '. $_current_module.'<br>';print_r($module_data);print_r($item);
continue;
}
}
//-----------------------------------------
// Force a module/section parameter into the input array
//-----------------------------------------
if ($app_dir == ipsRegistry::$current_application and ipsRegistry::$current_module == $item['module'] and !ipsRegistry::$request['section'] and $item['section']) {
ipsRegistry::$request['section'] = $item['section'];
}
//-----------------------------------------
// Add to nav?
//-----------------------------------------
if ($app_dir == ipsRegistry::$current_application and ipsRegistry::$request['section'] and ipsRegistry::$request['section'] == $item['section'] and ipsRegistry::$current_module == $item['module']) {
//-----------------------------------------
// Sure?
//-----------------------------------------
$_ok = 1;
$__sub_item_url = $item['url'] ? '&' . $item['url'] : '';
if (!$_nav_main_done) {
if (!$this->ignoreCoreNav) {
$this->core_nav[] = array($this->settings['base_url'] . 'module=' . $_current_module . '&section=' . $item['section'], $module_data['title']);
}
$_nav_main_done = 1;
//-----------------------------------------
// Sort out do param?
//-----------------------------------------
if ($item['url'] and !isset($_GET['do'])) {
$_do = str_replace("do=", "", $item['url']);
ipsRegistry::$request['do'] = $_do;
if (!stristr($this->settings['query_string_safe'], 'section=')) {
$this->settings['query_string_safe'] = $this->settings['query_string_safe'] . '&section=' . ipsRegistry::$request['section'];
}
$this->settings['query_string_safe'] = '&do=' . $_do;
}
}
if ($item['url']) {
/* Reset */
$_ok = 0;
/* Trying something a little different with the nav */
$_url = explode('=', $item['url']);
/* Now we're first going to check for an exact do match */
$_ok = $_url[1] == ipsRegistry::$request['do'];
/* No? Check the Query string then */
if (!$_ok) {
$_n = str_replace('&', '&', strtolower($item['url']));
$_h = str_replace('&', '&', strtolower(my_getenv('QUERY_STRING')));
if (strstr($_h, $_n)) {
$_ok = 1;
}
}
}
if (!$this->ignoreCoreNav and $_ok) {
$this->core_nav[] = array($this->settings['base_url'] . 'module=' . $_current_module . '&section=' . $item['section'] . $__sub_item_url, $item['title']);
}
}
//-----------------------------------------
// Continue...
//-----------------------------------------
if ($item['title'] and $item['section']) {
$this->menu[$app_dir][$__current_module]['items'][] = array('title' => $item['title'], 'module' => $_current_module, 'section' => $item['section'], 'url' => $item['url'], 'redirect' => $item['redirect']);
$this->menu[$app_dir][$__current_module]['title'] = count($this->menu[$app_dir][$__current_module]['items']) > 1 ? $module_data['title'] : $item['title'];
}
}
}
}
}
//print_r($this->menu);
if (isset($this->menu) && count($this->menu)) {
return $this->global_template->menu_sub_navigation($this->menu);
}
}
示例12: loginForm
/**
* Log the user out
*
* @param string Message to show on the form
* @return @e void
*/
public function loginForm($message = '')
{
//-----------------------------------------
// Hang on, do we need the upgrader?
//-----------------------------------------
if (!IN_DEV and (!defined('SKIP_UPGRADE_CHECK') or !SKIP_UPGRADE_CHECK)) {
require_once IPS_ROOT_PATH . 'setup/sources/base/setup.php';
/*noLibHook*/
foreach (ipsRegistry::$applications as $app_dir => $app) {
$_a = ($app_dir == 'forums' or $app_dir == 'members') ? 'core' : $app_dir;
$numbers = IPSSetUp::fetchAppVersionNumbers($_a);
if ($numbers['latest'][0] and $numbers['latest'][0] > $numbers['current'][0]) {
$this->registry->output->silentRedirect($this->settings['base_acp_url'] . '/upgrade/index.php?_acpRedirect=1');
return;
}
}
}
//-----------------------------------------
// INIT
//-----------------------------------------
$message = $message ? $message : $this->member->sessionClass()->getMessage();
//-------------------------------------------------------
// Remove all out of date sessions, like a good boy. Woof.
//-------------------------------------------------------
$cut_off_stamp = time() - 60 * 60 * 2;
$this->DB->delete('core_sys_cp_sessions', "session_running_time < {$cut_off_stamp}");
//------------------------------------------------------
// Start form
//------------------------------------------------------
$qs = str_replace('&', '&', IPSText::parseCleanValue(urldecode(my_getenv('QUERY_STRING'))));
$qs = str_replace('adsess=', 'old_adsess=', $qs);
$qs = str_replace('module=menu', '', $qs);
$additional_data = $this->han_login->additionalFormHTML();
$replace = false;
$data = array();
if (!is_null($additional_data) and is_array($additional_data) and count($additional_data)) {
$replace = $additional_data[0];
$data = $additional_data[1];
}
$uses_name = false;
$uses_email = false;
foreach (ipsRegistry::cache()->getCache('login_methods') as $method) {
$login_methods[$method['login_folder_name']] = $method['login_folder_name'];
if ($method['login_user_id'] == 'username' or $method['login_user_id'] == 'either') {
$uses_name = true;
}
if ($method['login_user_id'] == 'email' or $method['login_user_id'] == 'either') {
$uses_email = true;
}
}
if ($uses_name and $uses_email) {
$this->lang->words['gl_signinname'] = $this->lang->words['enter_name_and_email'];
} else {
if ($uses_email) {
$this->lang->words['gl_signinname'] = $this->lang->words['enter_useremail'];
} else {
$this->lang->words['gl_signinname'] = $this->lang->words['enter_username'];
}
}
ipsRegistry::getClass('output')->html_title = $this->lang->words['ipb_login'];
ipsRegistry::getClass('output')->html_main = ipsRegistry::getClass('output')->global_template->log_in_form($qs, $message, $replace == 'replace' ? true : false, $data);
ipsRegistry::getClass('output')->html_main = str_replace('<%TITLE%>', ipsRegistry::getClass('output')->html_title, ipsRegistry::getClass('output')->html_main);
@header("Content-type: text/html");
print ipsRegistry::getClass('output')->html_main;
exit;
}
示例13: globalTemplate
//.........这里部分代码省略.........
\t\t \t \t</div>
\t\t \t \t</div>
\t\t \t \t<div class='ipsLayout_content clearfix'>
EOF;
if (count($messages)) {
$IPBHTML .= <<<EOF
\t\t<br />
\t\t <div class='message' style='overflow:auto;max-height:180px'>
EOF;
foreach ($messages as $msg) {
$IPBHTML .= "<p>{$msg}</p>\n";
}
$IPBHTML .= <<<EOF
\t\t </div><br />
EOF;
}
if (count($errors) or count($warnings)) {
$IPBHTML .= <<<EOF
\t\t<br />
\t\t <div class='message error' style='overflow:auto;max-height:180px'>
EOF;
foreach ($errors as $msg) {
$IPBHTML .= "<p>Error: {$msg}</p>\n";
}
foreach ($warnings as $msg) {
$IPBHTML .= "<p>Warning: {$msg}</p>\n";
}
$IPBHTML .= <<<EOF
\t\t </div><br />
EOF;
}
$IPBHTML .= <<<EOF
\t\t \t <div>
\t\t \t \t<h3 class='maintitle'>{$_productName} {$_productVersion}</h3>
\t\t \t <div class='ipsBox'>
\t\t \t \t\t<div id='contentContainer' class='ipsBox_container ipsPad'>
\t\t \t {$content}
\t\t \t </div>
\t\t \t </div>
\t\t \t <div style='padding-top: 17px; padding-right: 15px; padding-left: 15px'>
\t\t \t <div style='float: right'>
EOF;
if ($data['hideButton'] !== TRUE and $this->_showNoButtons !== TRUE) {
if ($this->registry->output->nextAction == 'disabled' or count($errors)) {
$IPBHTML .= <<<EOF
\t\t \t <input type='submit' class='nav_button' value='Install can not continue...' disabled='disabled' />
EOF;
} else {
if (!$this->registry->output->nextAction) {
$back = my_getenv('HTTP_REFERER');
$IPBHTML .= <<<EOF
\t<input type='button' class='nav_button' value='< Back' onclick="window.location='{$back}';return false;" />
EOF;
}
$IPBHTML .= <<<EOF
\t\t \t <input type='submit' class='nav_button' value='Next >' />
EOF;
}
}
$date = date("Y");
$IPBHTML .= <<<EOF
\t\t\t\t\t\t</div>
\t\t\t\t\t</div> <!-- buttons -->
\t\t\t\t<br />
\t\t\t\t<br />
\t\t\t\t<div class='copyright'>
\t\t \t \t©
EOF;
$IPBHTML .= date("Y");
$IPBHTML .= <<<EOF
Invision Power Services, Inc.
\t\t\t\t</div>
\t\t\t</div><!-- ipsLayout_content -->
\t\t</div><!-- ipsLayout-->
\t</div><!-- content -->
</div><!-- wrapper -->
EOF;
/* Bit of a kludge */
if (is_array($errors) and count($errors)) {
$IPBHTML .= <<<EOF
\t\t<script type='text/javascript'>
\t\t//<![CDATA[
\t\tfunction form_redirect()
\t\t{
\t\t\treturn false;
\t\t}
\t\t//]]>
\t\t</script>
EOF;
}
$IPBHTML .= <<<EOF
\t\t</form>
\t
\t</body>
</html>
EOF;
return $IPBHTML;
}
示例14: addModerateLog
/**
* Add an entry to the moderator log
*
* @param integer Forum id
* @param integer Topic id
* @param string Topic title
* @param string Title to add to moderator log
* @return boolean
*/
public function addModerateLog($fid, $tid, $pid, $t_title, $mod_title = 'Unknown')
{
$this->DB->setDataType('member_name', 'string');
$this->DB->insert('moderator_logs', array('forum_id' => intval($fid), 'topic_id' => intval($tid), 'post_id' => intval($pid), 'member_id' => $this->memberData['member_id'], 'member_name' => $this->memberData['members_display_name'], 'ip_address' => $this->member->ip_address, 'http_referer' => htmlspecialchars(my_getenv('HTTP_REFERER')), 'ctime' => time(), 'topic_title' => $t_title, 'action' => $mod_title, 'query_string' => htmlspecialchars(my_getenv('QUERY_STRING'))));
return TRUE;
}
示例15: define
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @package Invision Power Board
* @version $Rev: 3887 $
*
*/
define('IPS_PUBLIC_SCRIPT', 'index.php');
require_once '../initdata.php';
require_once IPS_ROOT_PATH . 'sources/base/ipsRegistry.php';
/* INIT Registry */
$reg = ipsRegistry::instance();
$reg->init();
/* GET INPUT */
$url = my_getenv('REQUEST_URI') ? my_getenv('REQUEST_URI') : my_getenv('PHP_SELF');
$qs = my_getenv('QUERY_STRING');
$link = 'act=idx';
$id = 0;
$st = 0;
$justKeepMe = str_replace('.html', '', $qs ? $qs : str_replace("/", "", strrchr($url, "/")));
/* Got pages? */
if (strstr($justKeepMe, "-")) {
list($_mainBit, $_startBit) = explode("-", $justKeepMe);
$justKeepMe = $_mainBit;
$st = intval($_startBit);
}
if (strstr($justKeepMe, 't') and is_numeric(substr($justKeepMe, 1))) {
$id = intval(substr($justKeepMe, 1));
$link = 'showtopic=' . $id;
if ($st) {
$link .= '&st=' . $st;