WebGUI 0.9.0 release
This commit is contained in:
commit
c57a922892
51 changed files with 7351 additions and 0 deletions
45
lib/WebGUI/Operation/Admin.pm
Normal file
45
lib/WebGUI/Operation/Admin.pm
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
package WebGUI::Operation::Admin;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# WebGUI is Copyright 2001 Plain Black Software.
|
||||
#-------------------------------------------------------------------
|
||||
# Please read the legal notices (docs/legal.txt) and the license
|
||||
# (docs/license.txt) that came with this distribution before using
|
||||
# this software.
|
||||
#-------------------------------------------------------------------
|
||||
# http://www.plainblack.com info@plainblack.com
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
use Exporter;
|
||||
use strict;
|
||||
use WebGUI::Privilege;
|
||||
use WebGUI::Session;
|
||||
use WebGUI::SQL;
|
||||
|
||||
our @ISA = qw(Exporter);
|
||||
our @EXPORT = qw(&www_switchOffAdmin &www_switchOnAdmin);
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_switchOffAdmin {
|
||||
if ($session{var}{sessionId}) {
|
||||
WebGUI::SQL->write("update session set adminOn=0 where sessionId='$session{var}{sessionId}'",$session{dbh});
|
||||
WebGUI::Session::refreshSessionVars($session{var}{sessionId});
|
||||
return "";
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_switchOnAdmin {
|
||||
if ($session{var}{sessionId}) {
|
||||
WebGUI::SQL->write("update session set adminOn=1 where sessionId='$session{var}{sessionId}'",$session{dbh});
|
||||
WebGUI::Session::refreshSessionVars($session{var}{sessionId});
|
||||
return "";
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
1;
|
||||
Loading…
Add table
Add a link
Reference in a new issue