The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
Hello all,
I have various housekeeping scripts that are run by OS level scheduling, one of these is a database backup. During the backup I want the site to be gracefully closed so I knocked up a quick script that set the open/close state of the forum (this would be invoked via wget in my backup script) Code:
if ($vbulletin->GPC['do'] == 'open') { $vbulletin->options['bbactive'] = '1'; $vbulletin->options['bbclosedreason'] = ''; build_datastore('options', serialize($vbulletin->options), 1); echo 'Opened'; } else if ($vbulletin->GPC['do'] == 'close') { $vbulletin->options['bbactive'] = '0'; $vbulletin->options['bbclosedreason'] = 'This is closed'; build_datastore('options', serialize($vbulletin->options), 1); echo 'Closed'; } Now, this will allow me to gracefully close, however it does not allow me to open. The reason for this is that the script technically runs as guest. So when I read in global.php and init vbulletin aborts out as the site is closed. This mean that the open code above is never executed and the site remains closed. The obvious solution to this problem would be to get the script to login as an administrator (i.e. somebody who is allowed to bypass the close message), however I cannot find anything to do this. So the question is, how can I automate the login? --------------- Added [DATE]1254137747[/DATE] at [TIME]1254137747[/TIME] --------------- Actually I have found an alternative solution that seems to work. It is, shall we say, somewhat hacky but it does seem to work. In my script I originally had this: Code:
define('THIS_SCRIPT', 'bbactivetoggle'); Code:
define('THIS_SCRIPT', 'login'); It is a bit hacky but I don't think it will break anything. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|