/** * Сохранение картинок галлерей в БД */ public function saveGallery($gallery, $name, array $images) { AuthManager::checkAdminAccess(); $cnt = $this->getCnt('select count(1) as cnt from ps_gallery where v_dir=?', $gallery); if ($cnt == 0) { $this->insert('insert into ps_gallery (v_dir, v_name) VALUES (?, ?)', array($gallery, $name)); } else { $this->update('update ps_gallery set v_name=? where v_dir=?', array($name, $gallery)); } $this->update('delete from ps_gallery_images where v_dir=?', $gallery); $order = 0; foreach ($images as $img) { $this->saveImg($gallery, $img, ++$order); } }
/** @return AdminFoldedManager */ public static function inst() { AuthManager::checkAdminAccess(); return parent::inst(); }
public function getNotConfirmemMsgsCnt($threadId = null) { AuthManager::checkAdminAccess(); $threadId = is_numeric($threadId) ? $this->validateThreadId($threadId) : null; return $this->BEAN->getNotConfirmemMsgsCntDb($threadId); }
protected function __construct() { //Разрешаем работать с классом только администратору AuthManager::checkAdminAccess(); //Мы должны находиться не в продакшене PsDefines::assertProductionOff(__CLASS__); $this->LOGGER = PsLogger::inst(__CLASS__); $this->BEAN = TESTBean::inst(); }
public function deleteLocalImg($file) { AuthManager::checkAdminAccess(); GalleryBean::inst()->deleteLocalImg($this->gallery, $file); $this->DM->getDirItem(null, $file)->remove(); }
private function assertAdminCanDo($__FUNCTION__, $ident) { $this->LOGGER->info('{} вызвана для {}', $__FUNCTION__, $ident); AuthManager::checkAdminAccess(); }
public static final function getAll() { if (!is_array(self::$insts)) { //Только админ может загружать все аудиты AuthManager::checkAdminAccess(); //Инициализируем коллекцию self::$insts = array(); foreach (Classes::getDirClassNames(__DIR__, 'impl', __CLASS__) as $className) { $inst = $className::inst(); self::$insts[$inst->getProcessCode()] = $inst; } ksort(self::$insts); } return self::$insts; }