コード例 #1
0
ファイル: calendar.php プロジェクト: 0hyeah/yurivn
 $eventdata->setr_info('totime', $totime);
 $eventdata->setr_info('fromdate', $fromdate);
 $eventdata->setr_info('todate', $todate);
 $eventdata->setr_info('type', $vbulletin->GPC['type']);
 $eventdata->setr_info('recur', $vbulletin->GPC['recur']);
 $eventdata->set('title', $vbulletin->GPC['title']);
 $eventdata->set('event', $message);
 $eventdata->set('allowsmilies', empty($vbulletin->GPC['disablesmilies']) ? true : false);
 $eventdata->set('utc', $timezoneoffset);
 $eventdata->set('recurring', $type == 'recur' ? $vbulletin->GPC['recur']['pattern'] : 0);
 $eventdata->set('calendarid', $calendarinfo['calendarid']);
 $eventdata->set('dst', $dst);
 $eventdata->set_userfields($vbulletin->GPC['userfield']);
 if (!$eventinfo['eventid']) {
     // No Eventid == Insert Event
     if (can_moderate_calendar($calendarinfo['calendarid'], 'canmoderateevents')) {
         $eventdata->set('visible', 1);
         $visible = 1;
     } else {
         if (!($vbulletin->userinfo['calendarpermissions']["{$calendarinfo['calendarid']}"] & $vbulletin->bf_ugp_calendarpermissions['isnotmoderated']) or $calendarinfo['moderatenew']) {
             $eventdata->set('visible', 0);
             $visible = 0;
         } else {
             $eventdata->set('visible', 1);
             $visible = 1;
         }
     }
     $eventdata->set('userid', $vbulletin->userinfo['userid']);
     $eventdata->set('calendarid', $calendarinfo['calendarid']);
     $eventid = $eventdata->save();
     clear_autosave_text('vBForum_Calendar', 0, 0, $vbulletin->userinfo['userid']);
コード例 #2
0
ファイル: global.php プロジェクト: hungnv0789/vhtm
			AND dateline > " . iif($vbulletin->options['timeoutcontrolpanel'], intval(TIMENOW - $vbulletin->options['cookietimeout']), intval(TIMENOW - 3600))
	);

	if (!empty($cpsession))
	{
		$db->shutdown_query("
			UPDATE LOW_PRIORITY " . TABLE_PREFIX . "cpsession
			SET dateline = " . TIMENOW . "
			WHERE userid = " . $vbulletin->userinfo['userid'] . "
				AND hash = '" . $db->escape_string($vbulletin->GPC[COOKIE_PREFIX . 'cpsession']) . "'
		");
	}
}

define('CP_SESSIONHASH', $cpsession['hash']);

if ((!can_moderate() AND !can_moderate_calendar()) OR ($vbulletin->options['timeoutcontrolpanel'] AND !$vbulletin->session->vars['loggedin']) OR empty($vbulletin->GPC[COOKIE_PREFIX . 'cpsession']) OR $vbulletin->GPC[COOKIE_PREFIX . 'cpsession'] != $cpsession['hash'] OR empty($cpsession))
{
	print_cp_login();
}

($hook = vBulletinHook::fetch_hook('mod_global')) ? eval($hook) : false;

/*======================================================================*\
|| ####################################################################
|| # 
|| # CVS: $RCSfile$ - $Revision: 33812 $
|| ####################################################################
\*======================================================================*/
?>
コード例 #3
0
ファイル: global.php プロジェクト: holandacz/nb4
}
// ###################### Get date / time info #######################
// override date/time settings if specified
fetch_options_overrides($vbulletin->userinfo);
fetch_time_data();
// ############################################ LANGUAGE STUFF ####################################
// initialize $vbphrase and set language constants
$vbphrase = init_language();
$_tmp = NULL;
$stylevar = fetch_stylevars($_tmp, $vbulletin->userinfo);
$permissions = cache_permissions($vbulletin->userinfo, true);
$vbulletin->userinfo['permissions'] =& $permissions;
$cpsession = array();
$vbulletin->input->clean_array_gpc('c', array(COOKIE_PREFIX . 'cpsession' => TYPE_STR));
if (!empty($vbulletin->GPC[COOKIE_PREFIX . 'cpsession'])) {
    $cpsession = $db->query_first("\n\t\tSELECT * FROM " . TABLE_PREFIX . "cpsession\n\t\tWHERE userid = " . $vbulletin->userinfo['userid'] . "\n\t\t\tAND hash = '" . $db->escape_string($vbulletin->GPC[COOKIE_PREFIX . 'cpsession']) . "'\n\t\t\tAND dateline > " . iif($vbulletin->options['timeoutcontrolpanel'], intval(TIMENOW - $vbulletin->options['cookietimeout']), intval(TIMENOW - 3600)));
    if (!empty($cpsession)) {
        $db->shutdown_query("\n\t\t\tUPDATE LOW_PRIORITY " . TABLE_PREFIX . "cpsession\n\t\t\tSET dateline = " . TIMENOW . "\n\t\t\tWHERE userid = " . $vbulletin->userinfo['userid'] . "\n\t\t\t\tAND hash = '" . $db->escape_string($vbulletin->GPC[COOKIE_PREFIX . 'cpsession']) . "'\n\t\t");
    }
}
define('CP_SESSIONHASH', $cpsession['hash']);
if (!can_moderate() and !can_moderate_calendar() or $vbulletin->options['timeoutcontrolpanel'] and !$vbulletin->session->vars['loggedin'] or empty($vbulletin->GPC[COOKIE_PREFIX . 'cpsession']) or $vbulletin->GPC[COOKIE_PREFIX . 'cpsession'] != $cpsession['hash'] or empty($cpsession)) {
    print_cp_login();
}
($hook = vBulletinHook::fetch_hook('mod_global')) ? eval($hook) : false;
/*======================================================================*\
|| ####################################################################
|| # Downloaded: 08:19, Wed Nov 5th 2008
|| # CVS: $RCSfile$ - $Revision: 26608 $
|| ####################################################################
\*======================================================================*/
コード例 #4
0
ファイル: functions_login.php プロジェクト: hungnv0789/vhtm
function process_new_login($logintype, $cookieuser, $cssprefs)
{
	global $vbulletin;

	$lang_info = array(
		'lang_locale' => $vbulletin->userinfo['lang_locale'],
		'lang_charset' => $vbulletin->userinfo['lang_charset']
	);

	$vbulletin->db->query_write("DELETE FROM " . TABLE_PREFIX . "session WHERE sessionhash = '" . $vbulletin->db->escape_string($vbulletin->session->vars['dbsessionhash']) . "'");

	if ($vbulletin->session->created == true AND $vbulletin->session->vars['userid'] == 0)
	{
		// if we just created a session on this page, there's no reason not to use it
		$newsession =& $vbulletin->session;
	}
	else
	{
		$newsession = new vB_Session($vbulletin, '', $vbulletin->userinfo['userid'], '', $vbulletin->session->vars['styleid'], $vbulletin->session->vars['languageid']);
	}
	$newsession->set('userid', $vbulletin->userinfo['userid']);
	$newsession->set('loggedin', 1);
	if ($logintype == 'cplogin')
	{
		$newsession->set('bypass', 1);
	}
	else
	{
		$newsession->set('bypass', 0);
	}
	$newsession->set_session_visibility(($vbulletin->superglobal_size['_COOKIE'] > 0));
	$newsession->fetch_userinfo();
	$vbulletin->session =& $newsession;
	$vbulletin->userinfo = $newsession->userinfo;
	$vbulletin->userinfo['lang_locale'] = $lang_info['lang_locale'];
	$vbulletin->userinfo['lang_charset'] = $lang_info['lang_charset'];

	// admin control panel or upgrade script login
	if ($logintype === 'cplogin')
	{
		$permissions = cache_permissions($vbulletin->userinfo, false);
		$vbulletin->userinfo['permissions'] =& $permissions;
		if ($permissions['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['cancontrolpanel'])
		{
			if ($cssprefs != '')
			{
				$admininfo = $vbulletin->db->query_first_slave("SELECT * FROM " . TABLE_PREFIX . "administrator WHERE userid = " . $vbulletin->userinfo['userid']);
				if ($admininfo)
				{
					$admindm =& datamanager_init('Admin', $vbulletin, ERRTYPE_SILENT);
					$admindm->set_existing($admininfo);
					$admindm->set('cssprefs', $vbulletin->GPC['cssprefs']);
					$admindm->save();
				}
			}

			$cpsession = $vbulletin->session->fetch_sessionhash();
			/*insert query*/
			$vbulletin->db->query_write("INSERT INTO " . TABLE_PREFIX . "cpsession (userid, hash, dateline) VALUES (" . $vbulletin->userinfo['userid'] . ", '" . $vbulletin->db->escape_string($cpsession) . "', " . TIMENOW . ")");
			vbsetcookie('cpsession', $cpsession, false, true, true);

			if (!$cookieuser AND empty($vbulletin->GPC[COOKIE_PREFIX . 'userid']))
			{
				vbsetcookie('userid', $vbulletin->userinfo['userid'], false, true, true);
				vbsetcookie('password', md5($vbulletin->userinfo['password'] . COOKIE_SALT), false, true, true);
			}
		}
	}

	// moderator control panel login
	if ($logintype === 'modcplogin')
	{
		$permissions = cache_permissions($vbulletin->userinfo, false);
		$vbulletin->userinfo['permissions'] =& $permissions;

		require_once(DIR . '/includes/functions_calendar.php');
		if (can_moderate() OR can_moderate_calendar())
		{
			$cpsession = $vbulletin->session->fetch_sessionhash();
			/*insert query*/
			$vbulletin->db->query_write("INSERT INTO " . TABLE_PREFIX . "cpsession (userid, hash, dateline) VALUES (" . $vbulletin->userinfo['userid'] . ", '" . $vbulletin->db->escape_string($cpsession) . "', " . TIMENOW . ")");
			vbsetcookie('cpsession', $cpsession, false, true, true);

			if (!$cookieuser AND empty($vbulletin->GPC[COOKIE_PREFIX . 'userid']))
			{
				vbsetcookie('userid', $vbulletin->userinfo['userid'], false, true, true);
				vbsetcookie('password', md5($vbulletin->userinfo['password'] . COOKIE_SALT), false, true, true);
			}
		}
	}

	($hook = vBulletinHook::fetch_hook('login_process')) ? eval($hook) : false;
}
コード例 #5
0
ファイル: index.php プロジェクト: holandacz/nb4
     construct_nav_option($vbphrase['forum_manager'], 'forum.php?do=modify');
     construct_nav_group($vbphrase['announcements']);
     construct_nav_spacer();
 }
 // *************************************************
 $canmoderate = false;
 if (can_moderate(0, 'canmoderateposts')) {
     $canmoderate = true;
     construct_nav_option($vbphrase['moderate_threads'], 'moderate.php?do=posts');
     construct_nav_option($vbphrase['moderate_posts'], 'moderate.php?do=posts#posts');
 }
 if (can_moderate(0, 'canmoderateattachments')) {
     $canmoderate = true;
     construct_nav_option($vbphrase['moderate_attachments'], 'moderate.php?do=attachments');
 }
 if (can_moderate_calendar()) {
     $canmoderate = true;
     construct_nav_option($vbphrase['moderate_events'], 'moderate.php?do=events');
 }
 if (can_moderate(0, 'canmoderatevisitormessages')) {
     $canmoderate = true;
     construct_nav_option($vbphrase['moderate_visitor_messages'], 'moderate.php?do=messages');
 }
 if ($canmoderate) {
     construct_nav_group($vbphrase['moderation']);
     construct_nav_spacer();
 }
 // *************************************************
 $canuser = false;
 if (can_moderate(0, 'canunbanusers') or can_moderate(0, 'canbanusers') or can_moderate(0, 'canviewprofile') or can_moderate(0, 'caneditsigs') or can_moderate(0, 'caneditavatar')) {
     $canuser = true;
コード例 #6
0
        $eventinfo = array('eventid' => $eventid);
        // init event datamanager class
        $eventdata =& datamanager_init('Event', $vbulletin, ERRTYPE_SILENT);
        $eventdata->set_existing($eventinfo);
        if ($action == 1) {
            // validate
            $eventdata->verify_datetime = false;
            $eventdata->set('utc', $vbulletin->GPC['eventtimezone']["{$eventid}"]);
            if (can_moderate_calendar($getcalendarid['calendarid'], 'caneditevents')) {
                $eventdata->set('title', $vbulletin->GPC['eventsubject']["{$eventid}"]);
                $eventdata->set('event', $vbulletin->GPC['eventtext']["{$eventid}"]);
            }
            $eventdata->set('visible', 1);
            $eventdata->save();
        } else {
            if ($action == -1 and can_moderate_calendar($getcalendarid['calendarid'], 'candeleteevents')) {
                // delete
                $eventdata->delete();
            }
        }
    }
    define('CP_REDIRECT', 'moderate.php?do=events');
    print_stop_message('moderated_events_successfully');
}
// ###################### Start thread/post moderation #######################
if ($_REQUEST['do'] == 'posts') {
    // fetch threads and posts to be moderated from the moderation table
    // this saves a index on visible and a query with about 3 inner joins
    $threadids = array();
    $postids = array();
    $hasdelperm = array();
コード例 #7
0
ファイル: event.php プロジェクト: Kheros/MMOver
 public function can_edit($user)
 {
     if (can_moderate_calendar($calendarinfo['calendarid'], 'caneditevents')) {
         return true;
     }
     if ($this->get_field('userid') != $user->get_field('userid')) {
         return true;
     }
     if ($user->hasCalendarPermission($this->get_field('calendarid'), 'caneditevent')) {
         return true;
     }
     return false;
 }