• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP login_box函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中login_box函数的典型用法代码示例。如果您正苦于以下问题:PHP login_box函数的具体用法?PHP login_box怎么用?PHP login_box使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了login_box函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: needs_auth

 /**
  * Checks whether user is logged in and outputs login box
  * for guests or returns error response for registered users.
  *
  * @return Response object
  */
 public function needs_auth()
 {
     if (!$this->user->data['is_registered']) {
         login_box($this->get_current_url());
     }
     return $this->error($this->user->lang['NO_AUTH'], 403);
 }
开发者ID:Sajaki,项目名称:customisation-db,代码行数:13,代码来源:helper.php


示例2: base

    public function base()
    {
        $note = utf8_normalize_nfc($this->request->variable('note', '', true));
        $submit = isset($_POST['submit']) ? true : false;
        $error = array();
        // check if user s logged in, since this page can be used only after registration...
        if (!$this->user->data['is_registered']) {
            login_box($this->helper->route('vinny_usersnotes_controller'));
        }
        // ... and also this is not for bots (especially for bad ones :)
        if ($this->user->data['is_bot']) {
            redirect(append_sid("{$this->phpbb_root_path}index.{$this->phpEx}"));
        }
        $s_action = $this->helper->route('vinny_usersnotes_controller');
        $s_hidden_fields = '';
        add_form_key('postform');
        // create a template variables
        $this->template->assign_vars(array('S_POST_ACTION' => $s_action, 'S_HIDDEN_FIELDS' => $s_hidden_fields, 'ERROR' => sizeof($error) ? implode('<br />', $error) : ''));
        if ($submit) {
            /*if(!check_form_key('postform'))
            		{
            			trigger_error('FORM_INVALID');
            		}*/
            $sql = 'UPDATE ' . USERS_TABLE . '
				SET user_note = "' . $note . '"
				WHERE user_id = ' . $this->user->data['user_id'];
            $this->db->sql_query($sql);
            meta_refresh(3, $this->helper->route('vinny_usersnotes_controller'));
            trigger_error(sprintf($this->user->lang['NOTES_SAVED'], $this->helper->route('vinny_usersnotes_controller')));
        }
        // create a template variables
        $this->template->assign_vars(array('NOTE' => $this->user->data['user_note']));
        $this->template->assign_block_vars('navlinks', array('FORUM_NAME' => $this->user->lang['NOTES']));
        return $this->helper->render('notes.html', $this->user->lang['NOTES']);
    }
开发者ID:OfficeForum,项目名称:users-notes-ext,代码行数:35,代码来源:main.php


示例3: login_redirect

 public function login_redirect()
 {
     if (!$this->user->data['is_registered']) {
         login_box();
     }
     $this->template->assign_var('A_VARIABLE', 'I am a variable');
     return $this->helper->render('foo_bar_body.html');
 }
开发者ID:MrAdder,项目名称:phpbb,代码行数:8,代码来源:controller.php


示例4: main

 function main()
 {
     // Only registered users can go beyond this point
     if (!$this->user->data['is_registered']) {
         if ($this->user->data['is_bot']) {
             redirect(append_sid("{$this->phpbb_root_path}index.{$this->phpEx}"));
         }
         login_box('', $this->user->lang['LOGIN_INFO']);
     }
     $adm_points = $this->request->variable('adm_points', false);
     $u_id = $this->request->variable('user_id', 0);
     $post_id = $this->request->variable('post_id', 0);
     if (empty($u_id)) {
         $message = $this->user->lang['EDIT_NO_ID_SPECIFIED'] . '<br /><br /><a href="' . $this->helper->route('dmzx_ultimatepoints_controller', array('mode' => 'bank_edit')) . '">&laquo; ' . $this->user->lang['BACK_TO_PREV'] . '</a>';
         trigger_error($message);
     }
     $user_id = $u_id;
     add_form_key('bank_edit');
     if ($adm_points != false && ($this->auth->acl_get('a_') || $this->auth->acl_get('m_chg_bank'))) {
         $this->template->assign_block_vars('administer_bank', array());
         $submit = isset($_POST['submit']) ? true : false;
         if ($submit) {
             if (!check_form_key('bank_edit')) {
                 trigger_error('FORM_INVALID');
             }
             $new_points = round($this->request->variable('points', 0.0), 2);
             $this->functions_points->set_bank($u_id, $new_points);
             $sql_array = array('SELECT' => 'user_id, username, user_points, user_colour', 'FROM' => array(USERS_TABLE => 'u'), 'WHERE' => 'user_id = ' . (int) $u_id);
             $sql = $this->db->sql_build_query('SELECT', $sql_array);
             $result = $this->db->sql_query($sql);
             $points_user = $this->db->sql_fetchrow($result);
             // Add logs
             $this->log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_MOD_BANK', false, array($points_user['username']));
             $message = $post_id ? sprintf($this->user->lang['EDIT_P_RETURN_POST'], '<a href="' . append_sid("{$this->phpbb_root_path}viewtopic.{$this->phpEx}", "p=" . $post_id) . '">', '</a>') : sprintf($this->user->lang['EDIT_P_RETURN_INDEX'], '<a href="' . append_sid("{$this->phpbb_root_path}index.{$this->phpEx}") . '">', '</a>');
             trigger_error(sprintf($this->user->lang['EDIT_POINTS_SET'], $this->config['points_name']) . $message);
         } else {
             $sql_array = array('SELECT' => 'u.user_id, u.username, u.user_points, u.user_colour, b.holding', 'FROM' => array(USERS_TABLE => 'u'), 'LEFT_JOIN' => array(array('FROM' => array($this->points_bank_table => 'b'), 'ON' => 'u.user_id = b.user_id')), 'WHERE' => 'u.user_id = ' . (int) $u_id);
             $sql = $this->db->sql_build_query('SELECT', $sql_array);
             $result = $this->db->sql_query($sql);
             $row = $this->db->sql_fetchrow($result);
             if (empty($u_id)) {
                 $message = $this->user->lang['EDIT_USER_NOT_EXIST'] . '<br /><br /><a href="' . $this->helper->route('dmzx_ultimatepoints_controller', array('mode' => 'bank_edit')) . '">&laquo; ' . $this->user->lang['BACK_TO_PREV'] . '</a>';
                 trigger_error($message);
             }
             $hidden_fields = build_hidden_fields(array('user_id' => $u_id, 'post_id' => $post_id));
             $this->template->assign_vars(array('USER_NAME' => get_username_string('full', $u_id, $row['username'], $row['user_colour']), 'BANK_POINTS' => sprintf($this->functions_points->number_format_points($row['holding'])), 'POINTS_NAME' => $this->config['points_name'], 'CURRENT_VALUE' => $row['holding'], 'L_POINTS_MODIFY' => sprintf($this->user->lang['EDIT_BANK_MODIFY'], $this->config['points_name']), 'L_P_BANK_TITLE' => sprintf($this->user->lang['EDIT_P_BANK_TITLE'], $this->config['points_name']), 'L_USERNAME' => $this->user->lang['USERNAME'], 'L_SET_AMOUNT' => $this->user->lang['EDIT_SET_AMOUNT'], 'U_USER_LINK' => append_sid("{$this->phpbb_root_path}memberlist.{$this->phpEx}", "mode=viewprofile&amp;u=" . $u_id), 'S_ACTION' => $this->helper->route('dmzx_ultimatepoints_controller', array('mode' => 'bank_edit', 'adm_points' => '1')), 'S_HIDDEN_FIELDS' => $hidden_fields));
         }
     }
     // Generate the page
     page_header($this->user->lang['EDIT_POINTS_ADMIN']);
     // Generate the page template
     $this->template->set_filenames(array('body' => 'points/points_bank_edit.html'));
     page_footer();
 }
开发者ID:rampmaster,项目名称:Ultimate-Points-Extension,代码行数:54,代码来源:points_bank_edit.php


示例5: not_authorised

 public static function not_authorised($backlink, $loginlink = '', $login_explain = '')
 {
     global $user, $phpbb_container;
     $url = $phpbb_container->get('phpbbgallery.core.url');
     if (!$user->data['is_registered'] && $loginlink) {
         if ($login_explain && isset($user->lang[$login_explain])) {
             $login_explain = $user->lang[$login_explain];
         } else {
             $login_explain = '';
         }
         login_box($loginlink, $login_explain);
     } else {
         $url->meta_refresh(3, $backlink);
         trigger_error('NOT_AUTHORISED');
     }
 }
开发者ID:here-we-go,项目名称:phpbbgallery,代码行数:16,代码来源:misc.php


示例6: handle

 public function handle($notify_id = 0)
 {
     $this->user->add_lang_ext('gn36/versionchecknotifier', 'global');
     if (!$notify_id) {
         trigger_error('INVALID_NOTIFICATION_ID_REDIRECT');
     }
     if (!$this->user->data['is_registered']) {
         login_box();
     }
     $notifications = $this->manager->load_notifications(array('notification_id' => intval($notify_id)));
     if (!isset($notifications['notifications'][$notify_id])) {
         trigger_error('INVALID_NOTIFICATION_ID_REDIRECT');
     }
     /** @var $notification \phpbb\notification\type\base */
     $notification = $notifications['notifications'][$notify_id];
     $url = $notification->get_url();
     redirect($url, false, true);
 }
开发者ID:gn36,项目名称:phpbb-ext-versionchecknotifier,代码行数:18,代码来源:redirector.php


示例7: trigger_error

        trigger_error($message);
        break;
    default:
        $default = true;
        break;
}
// We use this approach because it does not impose large code changes
if (!$default) {
    return true;
}
// Only registered users can go beyond this point
if (!$user->data['is_registered']) {
    if ($user->data['is_bot']) {
        redirect(append_sid("{$phpbb_root_path}index.{$phpEx}"));
    }
    login_box('', $user->lang['LOGIN_EXPLAIN_UCP']);
}
// Instantiate module system and generate list of available modules
$module->list_modules('ucp');
// Check if the zebra module is set
if ($module->is_active('zebra', 'friends')) {
    // Output listing of friends online
    $update_time = $config['load_online_time'] * 60;
    $sql = $db->sql_build_query('SELECT_DISTINCT', array('SELECT' => 'u.user_id, u.username, u.username_clean, u.user_colour, MAX(s.session_time) as online_time, MIN(s.session_viewonline) AS viewonline', 'FROM' => array(USERS_TABLE => 'u', ZEBRA_TABLE => 'z'), 'LEFT_JOIN' => array(array('FROM' => array(SESSIONS_TABLE => 's'), 'ON' => 's.session_user_id = z.zebra_id')), 'WHERE' => 'z.user_id = ' . $user->data['user_id'] . '
			AND z.friend = 1
			AND u.user_id = z.zebra_id', 'GROUP_BY' => 'z.zebra_id, u.user_id, u.username_clean, u.user_colour, u.username', 'ORDER_BY' => 'u.username_clean ASC'));
    $result = $db->sql_query($sql);
    while ($row = $db->sql_fetchrow($result)) {
        $which = time() - $update_time < $row['online_time'] && ($row['viewonline'] || $auth->acl_get('u_viewonline')) ? 'online' : 'offline';
        $template->assign_block_vars("friends_{$which}", array('USER_ID' => $row['user_id'], 'U_PROFILE' => get_username_string('profile', $row['user_id'], $row['username'], $row['user_colour']), 'USER_COLOUR' => get_username_string('colour', $row['user_id'], $row['username'], $row['user_colour']), 'USERNAME' => get_username_string('username', $row['user_id'], $row['username'], $row['user_colour']), 'USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour'])));
    }
开发者ID:puring0815,项目名称:OpenKore,代码行数:31,代码来源:ucp.php


示例8: render_data_for_page


//.........这里部分代码省略.........
                    // Return for: \$this->helper->render(filename, lang_title);
                    return array('filename' => 'mchat_rules.html', 'lang_title' => $this->user->lang['MCHAT_HELP']);
                } else {
                    // Show no rules
                    trigger_error('MCHAT_NO_RULES', E_USER_NOTICE);
                }
                break;
                // whois function..
            // whois function..
            case 'whois':
                // Must have auths
                if ($mchat_mode == 'whois' && $mchat_ip) {
                    // function already exists..
                    if (!function_exists('user_ipwhois')) {
                        include $this->phpbb_root_path . 'includes/functions_user.' . $this->phpEx;
                    }
                    $this->user_ip = $this->request->variable('ip', '');
                    $this->template->assign_var('WHOIS', user_ipwhois($this->user_ip));
                    // Output the page
                    // Return for: \$this->helper->render(filename, lang_title);
                    return array('filename' => 'viewonline_whois.html', 'lang_title' => $this->user->lang['WHO_IS_ONLINE']);
                } else {
                    // Show not authorized
                    trigger_error('NO_AUTH_OPERATION', E_USER_NOTICE);
                }
                break;
                // Clean function...
            // Clean function...
            case 'clean':
                // User logged in?
                if (!$this->user->data['is_registered'] || !$mchat_founder) {
                    if (!$this->user->data['is_registered']) {
                        // Login box...
                        login_box('', $this->user->lang['LOGIN']);
                    } else {
                        if (!$mchat_founder) {
                            // Show not authorized
                            trigger_error('NO_AUTH_OPERATION', E_USER_NOTICE);
                        }
                    }
                }
                $mchat_redirect = $this->request->variable('redirect', '');
                $mchat_redirect = $mchat_redirect == 'index' ? append_sid("{$this->phpbb_root_path}index.{$this->phpEx}") : $this->helper->route('dmzx_mchat_controller', array('#mChat'));
                if (confirm_box(true)) {
                    // Run cleaner
                    $sql = 'TRUNCATE TABLE ' . $this->mchat_table;
                    $this->db->sql_query($sql);
                    meta_refresh(3, $mchat_redirect);
                    trigger_error($this->user->lang['MCHAT_CLEANED'] . '<br /><br />' . sprintf($this->user->lang['RETURN_PAGE'], '<a href="' . $mchat_redirect . '">', '</a>'));
                } else {
                    // Display confirm box
                    confirm_box(false, $this->user->lang['MCHAT_DELALLMESS']);
                }
                $this->phpbb_log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_MCHAT_TABLE_PRUNED');
                redirect($mchat_redirect);
                break;
                // Archive function...
            // Archive function...
            case 'archive':
                if (!$mchat_read_archive || !$mchat_view) {
                    // redirect to correct page
                    $mchat_redirect = append_sid("{$this->phpbb_root_path}index.{$this->phpEx}");
                    // Redirect to previous page
                    meta_refresh(3, $mchat_redirect);
                    trigger_error($this->user->lang['MCHAT_NOACCESS_ARCHIVE'] . '<br /><br />' . sprintf($this->user->lang['RETURN_PAGE'], '<a href="' . $mchat_redirect . '">', '</a>'));
                }
开发者ID:ezpz-cz,项目名称:web-plugins,代码行数:67,代码来源:render_helper.php


示例9: trigger_error

$db->sql_freeresult($result);
if (!$forum_data) {
    trigger_error('NO_FORUM');
}
// Configure style, language, etc.
$user->setup('viewforum', $forum_data['forum_style']);
// Redirect to login upon emailed notification links
if (isset($_GET['e']) && !$user->data['is_registered']) {
    login_box('', $user->lang['LOGIN_NOTIFY_FORUM']);
}
// Permissions check
if (!$auth->acl_gets('f_list', 'f_read', $forum_id) || $forum_data['forum_type'] == FORUM_LINK && $forum_data['forum_link'] && !$auth->acl_get('f_read', $forum_id)) {
    if ($user->data['user_id'] != ANONYMOUS) {
        trigger_error('SORRY_AUTH_READ');
    }
    login_box('', $user->lang['LOGIN_VIEWFORUM']);
}
// Forum is passworded ... check whether access has been granted to this
// user this session, if not show login box
if ($forum_data['forum_password']) {
    login_forum_box($forum_data);
}
// Is this forum a link? ... User got here either because the
// number of clicks is being tracked or they guessed the id
if ($forum_data['forum_type'] == FORUM_LINK && $forum_data['forum_link']) {
    // Does it have click tracking enabled?
    if ($forum_data['forum_flags'] & FORUM_FLAG_LINK_TRACK) {
        $sql = 'UPDATE ' . FORUMS_TABLE . '
			SET forum_posts_approved = forum_posts_approved + 1
			WHERE forum_id = ' . $forum_id;
        $db->sql_query($sql);
开发者ID:ZerGabriel,项目名称:phpbb,代码行数:31,代码来源:viewforum.php


示例10: trigger_error

        if ($user->data['is_registered'] && $auth->acl_gets('f_edit', 'm_edit', $forum_id)) {
            $is_authed = true;
        }
        break;
    case 'delete':
        if ($user->data['is_registered'] && $auth->acl_gets('f_delete', 'm_delete', $forum_id)) {
            $is_authed = true;
        }
        break;
}
if (!$is_authed) {
    $check_auth = $mode == 'quote' ? 'reply' : $mode;
    if ($user->data['is_registered']) {
        trigger_error('USER_CANNOT_' . strtoupper($check_auth));
    }
    login_box('', $user->lang['LOGIN_EXPLAIN_' . strtoupper($mode)]);
}
// Is the user able to post within this forum?
if ($post_data['forum_type'] != FORUM_POST && in_array($mode, array('post', 'bump', 'quote', 'reply'))) {
    trigger_error('USER_CANNOT_FORUM_POST');
}
// Forum/Topic locked?
if (($post_data['forum_status'] == ITEM_LOCKED || isset($post_data['topic_status']) && $post_data['topic_status'] == ITEM_LOCKED) && !$auth->acl_get('m_edit', $forum_id)) {
    trigger_error($post_data['forum_status'] == ITEM_LOCKED ? 'FORUM_LOCKED' : 'TOPIC_LOCKED');
}
// Can we edit this post ... if we're a moderator with rights then always yes
// else it depends on editing times, lock status and if we're the correct user
if ($mode == 'edit' && !$auth->acl_get('m_edit', $forum_id)) {
    if ($user->data['user_id'] != $post_data['poster_id']) {
        trigger_error('USER_CANNOT_EDIT');
    }
开发者ID:PetsFundation,项目名称:Pets,代码行数:31,代码来源:posting.php


示例11: extract

extract($phpbb_dispatcher->trigger_event('core.viewtopic_before_f_read_check', compact($vars)));
// Start auth check
if (!$overrides_f_read_check && !$auth->acl_get('f_read', $forum_id)) {
    if ($user->data['user_id'] != ANONYMOUS) {
        trigger_error('SORRY_AUTH_READ');
    }
    login_box('', $user->lang['LOGIN_VIEWFORUM']);
}
// Forum is passworded ... check whether access has been granted to this
// user this session, if not show login box
if (!$overrides_forum_password_check && $topic_data['forum_password']) {
    login_forum_box($topic_data);
}
// Redirect to login upon emailed notification links if user is not logged in.
if (isset($_GET['e']) && $user->data['user_id'] == ANONYMOUS) {
    login_box(build_url('e') . '#unread', $user->lang['LOGIN_NOTIFY_TOPIC']);
}
// What is start equal to?
if ($post_id) {
    $start = floor($topic_data['prev_posts'] / $config['posts_per_page']) * $config['posts_per_page'];
}
// Get topic tracking info
if (!isset($topic_tracking_info)) {
    $topic_tracking_info = array();
    // Get topic tracking info
    if ($config['load_db_lastread'] && $user->data['is_registered']) {
        $tmp_topic_data = array($topic_id => $topic_data);
        $topic_tracking_info = get_topic_tracking($forum_id, $topic_id, $tmp_topic_data, array($forum_id => $topic_data['forum_mark_time']));
        unset($tmp_topic_data);
    } else {
        if ($config['load_anon_lastread'] || $user->data['is_registered']) {
开发者ID:ramukumar555,项目名称:phpbb,代码行数:31,代码来源:viewtopic.php


示例12: define

*/
/**
* @ignore
*/
define('IN_PHPBB', true);
$phpbb_root_path = defined('PHPBB_ROOT_PATH') ? PHPBB_ROOT_PATH : '../';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include $phpbb_root_path . 'common.' . $phpEx;
require $phpbb_root_path . 'ads/constants.' . $phpEx;
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup('mods/info_acp_ads');
// Display a login box if they are not logged in
if (!$user->data['is_registered']) {
    login_box();
}
if (!file_exists($phpbb_root_path . 'umil/umil_frontend.' . $phpEx)) {
    trigger_error('Please download the latest UMIL (Unified MOD Install Library) from: <a href="http://www.phpbb.com/mods/umil/">phpBB.com/mods/umil</a>', E_USER_ERROR);
}
include $phpbb_root_path . 'umil/umil_frontend.' . $phpEx;
$umil = new umil_frontend('ACP_ADVERTISEMENT_MANAGEMENT', true);
// Check after initiating UMIL.
if ($user->data['user_type'] != USER_FOUNDER) {
    trigger_error('FOUNDERS_ONLY');
}
if ($umil->confirm_box(true)) {
    include $phpbb_root_path . 'ads/versions.' . $phpEx;
    $umil->run_actions('uninstall', $versions, 'ads_version');
} else {
    $umil->display_stages(array('CONFIRM', 'UNINSTALL'));
开发者ID:EXreaction,项目名称:Advertisement-Management,代码行数:31,代码来源:uninstall.php


示例13: redirect

// Start session management
//$user->session_begin();
//$auth->acl($user->data);

global $config, $db, $user, $auth, $template, $cache;
global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix;

$db->return_on_error = 1;

if (!$user->data['is_registered'])
{
    if ($user->data['is_bot'])
    {
        redirect(append_sid("{$phpbb_root_path}index.$phpEx"));
    }
    login_box('', 'LOGIN');
}
else if ($user->data['user_type'] != USER_FOUNDER)
{
	die('You are not allowed in here. :)');
}

//if (isset($config['photo_gallery_version']) && version_compare($config['photo_gallery_version'], '0.1.0', '>='))
//{
//	trigger_error('you already have the latest photo gallery installed');
//	exit;
//}

switch ($db->sql_layer)
{
	case 'mysql':
开发者ID:pombredanne,项目名称:ArcherSys,代码行数:31,代码来源:gallery_db.php


示例14: main

    function main($id, $mode)
    {
        global $config, $phpbb_root_path, $phpEx;
        global $db, $user, $auth, $template;
        $user_id = request_var('u', 0);
        $key = request_var('k', '');
        $sql = 'SELECT user_id, username, user_type, user_email, user_newpasswd, user_lang, user_notify_type, user_actkey, user_inactive_reason
			FROM ' . USERS_TABLE . "\n\t\t\tWHERE user_id = {$user_id}";
        $result = $db->sql_query($sql);
        $user_row = $db->sql_fetchrow($result);
        $db->sql_freeresult($result);
        if (!$user_row) {
            trigger_error('NO_USER');
        }
        if ($user_row['user_type'] != USER_INACTIVE && !$user_row['user_newpasswd']) {
            meta_refresh(3, append_sid("{$phpbb_root_path}index.{$phpEx}"));
            trigger_error('ALREADY_ACTIVATED');
        }
        if ($user_row['user_inactive_reason'] == INACTIVE_MANUAL || $user_row['user_actkey'] != $key) {
            trigger_error('WRONG_ACTIVATION');
        }
        // Do not allow activating by non administrators when admin activation is on
        // Only activation type the user should be able to do is INACTIVE_REMIND
        // or activate a new password which is not an activation state :@
        if (!$user_row['user_newpasswd'] && $user_row['user_inactive_reason'] != INACTIVE_REMIND && $config['require_activation'] == USER_ACTIVATION_ADMIN && !$auth->acl_get('a_user')) {
            if (!$user->data['is_registered']) {
                login_box('', $user->lang['NO_AUTH_OPERATION']);
            }
            trigger_error('NO_AUTH_OPERATION');
        }
        $update_password = $user_row['user_newpasswd'] ? true : false;
        if ($update_password) {
            $sql_ary = array('user_actkey' => '', 'user_password' => $user_row['user_newpasswd'], 'user_newpasswd' => '', 'user_pass_convert' => 0, 'user_login_attempts' => 0);
            $sql = 'UPDATE ' . USERS_TABLE . '
				SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
				WHERE user_id = ' . $user_row['user_id'];
            $db->sql_query($sql);
            add_log('user', $user_row['user_id'], 'LOG_USER_NEW_PASSWORD', $user_row['username']);
        }
        if (!$update_password) {
            include_once $phpbb_root_path . 'includes/functions_user.' . $phpEx;
            user_active_flip('activate', $user_row['user_id']);
            $sql = 'UPDATE ' . USERS_TABLE . "\n\t\t\t\tSET user_actkey = ''\n\t\t\t\tWHERE user_id = {$user_row['user_id']}";
            $db->sql_query($sql);
            // Create the correct logs
            add_log('user', $user_row['user_id'], 'LOG_USER_ACTIVE_USER');
            if ($auth->acl_get('a_user')) {
                add_log('admin', 'LOG_USER_ACTIVE', $user_row['username']);
            }
        }
        if ($config['require_activation'] == USER_ACTIVATION_ADMIN && !$update_password) {
            include_once $phpbb_root_path . 'includes/functions_messenger.' . $phpEx;
            $messenger = new messenger(false);
            $messenger->template('admin_welcome_activated', $user_row['user_lang']);
            $messenger->to($user_row['user_email'], $user_row['username']);
            $messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']);
            $messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
            $messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']);
            $messenger->headers('X-AntiAbuse: User IP - ' . $user->ip);
            $messenger->assign_vars(array('USERNAME' => htmlspecialchars_decode($user_row['username'])));
            $messenger->send($user_row['user_notify_type']);
            $message = 'ACCOUNT_ACTIVE_ADMIN';
        } else {
            if (!$update_password) {
                $message = $user_row['user_inactive_reason'] == INACTIVE_PROFILE ? 'ACCOUNT_ACTIVE_PROFILE' : 'ACCOUNT_ACTIVE';
            } else {
                $message = 'PASSWORD_ACTIVATED';
            }
        }
        meta_refresh(3, append_sid("{$phpbb_root_path}index.{$phpEx}"));
        trigger_error($user->lang[$message]);
    }
开发者ID:noprom,项目名称:cryptdb,代码行数:72,代码来源:ucp_activate.php


示例15: if

		if (!$config['load_unreads_search'])
		{
			$template->assign_var('S_NO_SEARCH', true);
			trigger_error('NO_SEARCH_UNREADS');
		}
		else if (!$config['load_anon_lastread'] && !$user->data['is_registered'])
		{
			login_box('', $user->lang['LOGIN_EXPLAIN_UNREADSEARCH']);
		}
	break;

	// The "new posts" search uses user_lastvisit which is user based, so it should require user to log in.
	case 'newposts':
		if ($user->data['user_id'] == ANONYMOUS)
		{
			login_box('', $user->lang['LOGIN_EXPLAIN_NEWPOSTS']);
		}
	break;

	default:
		// There's nothing to do here for now ;)
	break;
}

// Is user able to search? Has search been disabled?
if (!$auth->acl_get('u_search') || !$auth->acl_getf_global('f_search') || !$config['load_search'])
{
	$template->assign_var('S_NO_SEARCH', true);
	trigger_error('NO_SEARCH');
}
开发者ID:abhinay100,项目名称:phpbb_app,代码行数:30,代码来源:search.php


示例16: trigger_error

$result = $_CLASS['core_db']->query($sql);
$posting_data = $_CLASS['core_db']->fetch_row_assoc($result);
$_CLASS['core_db']->free_result($result);
if (!$posting_data) {
    trigger_error('NO_POST');
}
require_once $site_file_root . 'includes/forums/message_parser.php';
require_once $site_file_root . 'includes/forums/functions_admin.php';
require_once $site_file_root . 'includes/forums/functions_posting.php';
// remove
extract($posting_data);
if ($posting_data['forum_type'] == FORUM_POST && !$_CLASS['auth']->acl_get('f_' . $mode, $forum_id) && !$_CLASS['auth']->acl_get('m_' . $mode, $forum_id)) {
    if ($_CLASS['core_user']->is_user) {
        trigger_error('USER_CANNOT_' . strtoupper($mode));
    }
    login_box(array('explain' => $_CLASS['core_user']->lang['LOGIN_EXPLAIN_' . strtoupper($mode)]));
}
$forum_id = (int) $posting_data['forum_id'];
$topic_id = (int) $topic_id;
$post_id = (int) $post_id;
$posting_data['post_edit_locked'] = isset($posting_data['post_edit_locked']) ? (int) $posting_data['post_edit_locked'] : false;
$_CLASS['core_user']->add_lang(array('posting', 'mcp', 'viewtopic'));
$_CLASS['core_user']->add_img();
if ($forum_password) {
    $forum_info = array('forum_id' => $forum_id, 'forum_password' => $forum_password);
    login_forum_box($forum_info);
    unset($forum_info);
}
$post_subject = in_array($mode, array('quote', 'edit', 'delete')) ? $posting_data['post_subject'] : (isset($posting_data['topic_title']) ? $posting_data['topic_title'] : '');
$topic_time_limit = isset($posting_data['topic_time_limit']) && $posting_data['topic_time_limit'] ? (int) $posting_data['topic_time_limit'] / 86400 : 0;
$poll_length = isset($poll_length) ? $poll_length ? (int) $poll_length / 86400 : (int) $poll_length : 0;
开发者ID:BackupTheBerlios,项目名称:viperals-svn,代码行数:31,代码来源:posting.php


示例17: p_master

//$fb_uid = $facebook->get_loggedin_user();
$fb_uid = $facebook->require_login();
if (!$fb_uid) {
    exit;
}
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup('mods/facebook-connect');
$module = new p_master();
// phpBB login
if (!$user->data['is_registered']) {
    if ($user->data['is_bot']) {
        redirect(append_sid("{$phpbb_root_path}index.{$phpEx}"));
    }
    login_box('', $user->lang['LOGIN_EXPLAIN_FACEBOOK']);
}
// At this point, we are connected to both facebook and phpBB
// id facebook et user courant correspondent
// id facebook et user courant ne correspondent pas:
// id facebook 'trusted' présent mais pour un autre compte (et le facebok id de ce compte est vide  ... ou pas)
// le compte courant a un facebook id autre que celui annoncé
// The facebook id is in the user row ?
if ($user->data['facebook_id']) {
    // The facebook id is registered, and owned by the user connected
    if ($user->data['facebook_id'] == $fb_uid) {
        meta_refresh(3, append_sid("{$phpbb_root_path}/index.{$phpEx}"));
        $message = $user->lang['FACEBOOK_ACCOUNT_ALREADY_LINKED'] . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid("{$phpbb_root_path}index.{$phpEx}") . '">', '</a>');
        trigger_error($message);
    } else {
        // Check who own the faceebook id
开发者ID:phpbbopenid,项目名称:facebook,代码行数:31,代码来源:facebook_linking.php


示例18: array

* @var	bool	is_authed	Does the user have the required permissions?
* @since 3.1.3-RC1
*/
$vars = array('post_id', 'topic_id', 'forum_id', 'draft_id', 'lastclick', 'submit', 'preview', 'save', 'load', 'refresh', 'mode', 'error', 'is_authed');
extract($phpbb_dispatcher->trigger_event('core.modify_posting_auth', compact($vars)));
if (!$is_authed) {
    $check_auth = $mode == 'quote' ? 'reply' : $mode;
    if ($user->data['is_registered']) {
        trigger_error('USER_CANNOT_' . strtoupper($check_auth));
    }
    $message = $user->lang['LOGIN_EXPLAIN_' . strtoupper($mode)];
    if ($request->is_ajax()) {
        $json = new phpbb\json_response();
        $json->send(array('title' => $user->lang['INFORMATION'], 'message' => $message));
    }
    login_box('', $message);
}
// Is the user able to post within this forum?
if ($post_data['forum_type'] != FORUM_POST && in_array($mode, array('post', 'bump', 'quote', 'reply'))) {
    trigger_error('USER_CANNOT_FORUM_POST');
}
// Forum/Topic locked?
if (($post_data['forum_status'] == ITEM_LOCKED || isset($post_data['topic_status']) && $post_data['topic_status'] == ITEM_LOCKED) && !$auth->acl_get('m_edit', $forum_id)) {
    trigger_error($post_data['forum_status'] == ITEM_LOCKED ? 'FORUM_LOCKED' : 'TOPIC_LOCKED');
}
// Can we edit this post ... if we're a moderator with rights then always yes
// else it depends on editing times, lock status and if we're the correct user
if ($mode == 'edit' && !$auth->acl_get('m_edit', $forum_id)) {
    $force_edit_allowed = false;
    $s_cannot_edit = $user->data['user_id'] != $post_data['poster_id'];
    $s_cannot_edit_time = $config['edit_time'] && $post_data['post_time'] <= time() - $config['edit_time'] * 60;
开发者ID:tassinmael,项目名称:thatforum,代码行数:31,代码来源:posting.php


示例19: array

	// egosearch is an author search
	if ($search_id == 'egosearch')
	{
		$author_id = $user->data['user_id'];

		if ($user->data['user_id'] == ANONYMOUS)
		{
			login_box('', $user->lang['LOGIN_EXPLAIN_EGOSEARCH']);
		}
	}

	// search for unread posts needs user to be logged in
	// if topics tracking for guests is disabled
	if ($search_id == 'unreadposts' && !$config['load_anon_lastread'] && !$user->data['is_registered'])
	{
		login_box('', $user->lang['LOGIN_EXPLAIN_UNREADSEARCH']);
	}

	// If we are looking for authors get their ids
	$author_id_ary = array();
	$sql_author_match = '';
	if ($author_id)
	{
		$author_id_ary[] = $author_id;
	}
	else if ($author)
	{
		if ((strpos($author, '*') !== false) && (utf8_strlen(str_replace(array('*', '%'), '', $author)) < $config['min_search_author_chars']))
		{
			trigger_error(sprintf($user->lang['TOO_FEW_AUTHOR_CHARS'], $config['min_search_author_chars']));
		}
开发者ID:renemilk,项目名称:spring-website,代码行数:31,代码来源:search.php


示例20: add_form_key

$user->setup(array('posting', 'lang_meeting', 'meetings', 'viewtopic', 'mods/gallery'));
$gallery_root_path = GALLERY_ROOT_PATH;
include_once "{$phpbb_root_path}{$gallery_root_path}includes/common.{$phpEx}";
include_once "{$phpbb_root_path}{$gallery_root_path}includes/permissions.{$phpEx}";
add_form_key('gallery');
/**
*/
// Set start point for meeting overview list
$config['posts_per_page'] = $user->data['user_posts_per_page'];
$per_page = $config['posts_per_page'];
// Start auth check
if (!$auth->acl_get('u_meeting_view')) {
    if ($user->data['user_id'] != ANONYMOUS) {
        trigger_error('MEETING_AUTH_NO_VIEW');
    }
    login_box('', $user->lang['LOGIN_VIEWMEETING']);
}
// Grab Meeting config
$sql = 'SELECT *
	FROM ' . MEETING_CONFIG_TABLE;
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) {
    $meeting_config[$row['config_name']] = $row['config_value'];
}
$db->sql_freeresult($result);
// Grab only parameters needed here
$id = request_var('id', 0);
$mode = request_var('mode', '');
$video = request_var('album_video', '');
//++++++++++++++++++++++++++++++++++++++++++++++++
$mode = !$mode ? 'detail' : $mode;
开发者ID:velocat,项目名称:phpbb3,代码行数:31,代码来源:meeting_video_block.php



注:本文中的login_box函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP login_check函数代码示例发布时间:2022-05-15
下一篇:
PHP login_attempt_valid函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap