<?php
 class vB_DataManager_Admin extends vB_DataManager { var $validfields = [ 'userid' => [vB_Cleaner::TYPE_UINT, vB_DataManager_Constants::REQ_YES, vB_DataManager_Constants::VF_METHOD], 'adminpermissions' => [vB_Cleaner::TYPE_UINT, vB_DataManager_Constants::REQ_NO], 'navprefs' => [vB_Cleaner::TYPE_STR, vB_DataManager_Constants::REQ_NO, vB_DataManager_Constants::VF_METHOD], 'cssprefs' => [vB_Cleaner::TYPE_STR, vB_DataManager_Constants::REQ_NO, vB_DataManager_Constants::VF_METHOD], 'notes' => [vB_Cleaner::TYPE_NOHTML, vB_DataManager_Constants::REQ_NO], 'dismissednews' => [vB_Cleaner::TYPE_NOCLEAN,vB_DataManager_Constants::REQ_NO, vB_DataManager_Constants::VF_METHOD, 'verify_commalist'], ]; protected $bitfields = ['adminpermissions' => 'bf_ugp_adminpermissions']; protected $table = 'vBForum:administrator'; public $keyField = 'userid'; protected $administrator = []; public function set_bitfield($fieldname, $bitname, $onoff) { if ($fieldname == 'adminpermissions' AND ($bitname == 'ismoderator' OR $bitname == 'cancontrolpanel')) { return false; } return parent::set_bitfield($fieldname, $bitname, $onoff); } function verify_navprefs(&$navprefs) { if (!preg_match('#^(\w+_[0-9]+,?)*$#', $navprefs)) { $navprefs = ''; } return true; } function verify_cssprefs(&$cssprefs) { $cssprefs = basename($cssprefs); if (!@file_exists(DIR . "/cpstyles/$cssprefs/controlpanel.css")) { $cssprefs = ''; } return true; } function pre_save($doquery = true) { if ($this->presave_called !== null) { return $this->presave_called; } $return_value = true; $this->presave_called = $return_value; return $return_value; } function post_save_each($doquery = true) { return true; } function post_delete($doquery = true) { return true; } } 