コード例 #1
0
ファイル: suspend.php プロジェクト: trabisdementia/xuups
//  along with this program; if not, write to the Free Software              //
//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
//  ------------------------------------------------------------------------ //
include_once '../../mainfile.php';
include_once '../../header.php';
include_once '../../class/criteria.php';
include_once '../../class/criteria.php';
include_once 'class/yogurt_suspensions.php';
if (!$GLOBALS['xoopsSecurity']->check()) {
    redirect_header($_SERVER['HTTP_REFERER'], 5, _MD_YOGURT_TOKENEXPIRED);
}
$uid = intval($_POST['uid']);
/**
* Creating the factory  loading the picture changing its caption
*/
$suspensions_factory = new Xoopsyogurt_suspensionsHandler($xoopsDB);
$suspension = $suspensions_factory->create(false);
$suspension->load($uid);
if ($xoopsUser->isAdmin(1)) {
    $member_handler =& xoops_gethandler('member');
    $thisUser =& $member_handler->getUser($uid);
    $suspension->setVar('uid', $uid);
    $suspension->setVar('old_email', $thisUser->getVar('email'));
    $suspension->setVar('old_pass', $thisUser->getVar('pass'));
    if (defined(ICMS_VERSION_NAME)) {
        $thisUser->setVar('old_salt', $thisUser->getVar('salt'));
        $thisUser->setVar('old_pass_expired', $thisUser->getVar('pass_expired'));
        $thisUser->setVar('old_enc_type', $thisUser->getVar('enc_type'));
    }
    $suspension->setVar('old_signature', $thisUser->getVar('user_sig'));
    $suspension->setVar('suspension_time', time() + intval($_POST['time']));
コード例 #2
0
//  along with this program; if not, write to the Free Software              //
//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
//  ------------------------------------------------------------------------ //
include_once '../../mainfile.php';
include_once '../../header.php';
include_once '../../class/criteria.php';
include_once '../../class/criteria.php';
include_once 'class/yogurt_suspensions.php';
if (!$GLOBALS['xoopsSecurity']->check()) {
    redirect_header($_SERVER['HTTP_REFERER'], 3, _MD_YOGURT_TOKENEXPIRED);
}
$uid = intval($_POST['uid']);
/**
* Creating the factory  loading the picture changing its caption
*/
$suspensions_factory = new Xoopsyogurt_suspensionsHandler($xoopsDB);
$suspension = $suspensions_factory->create(false);
$suspension->load($uid);
if ($xoopsUser->isAdmin(1)) {
    $member_handler =& xoops_gethandler('member');
    $thisUser =& $member_handler->getUser($uid);
    $thisUser->setVar('email', $suspension->getVar('old_email', 'n'));
    $thisUser->setVar('pass', $suspension->getVar('old_pass', 'n'));
    if (defined(ICMS_VERSION_NAME)) {
        $thisUser->setVar('salt', $suspension->getVar('old_salt', 'n'));
        $thisUser->setVar('pass_expired', $suspension->getVar('old_pass_expired', 'n'));
        $thisUser->setVar('enc_type', $suspension->getVar('old_enc_type', 'n'));
    }
    $thisUser->setVar('user_sig', $suspension->getVar('old_signature', 'n'));
    $member_handler->insertUser($thisUser);
    $criteria = new Criteria('uid', $uid);