コード例 #1
0
ファイル: GalleryBean.php プロジェクト: ilivanoff/www
 /**
  * Сохранение картинок галлерей в БД
  */
 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);
     }
 }
コード例 #2
0
 /** @return AdminFoldedManager  */
 public static function inst()
 {
     AuthManager::checkAdminAccess();
     return parent::inst();
 }
コード例 #3
0
 public function getNotConfirmemMsgsCnt($threadId = null)
 {
     AuthManager::checkAdminAccess();
     $threadId = is_numeric($threadId) ? $this->validateThreadId($threadId) : null;
     return $this->BEAN->getNotConfirmemMsgsCntDb($threadId);
 }
コード例 #4
0
ファイル: TestManager.php プロジェクト: ilivanoff/ps-sdk-dev
 protected function __construct()
 {
     //Разрешаем работать с классом только администратору
     AuthManager::checkAdminAccess();
     //Мы должны находиться не в продакшене
     PsDefines::assertProductionOff(__CLASS__);
     $this->LOGGER = PsLogger::inst(__CLASS__);
     $this->BEAN = TESTBean::inst();
 }
コード例 #5
0
ファイル: PsGallery.php プロジェクト: ilivanoff/www
 public function deleteLocalImg($file)
 {
     AuthManager::checkAdminAccess();
     GalleryBean::inst()->deleteLocalImg($this->gallery, $file);
     $this->DM->getDirItem(null, $file)->remove();
 }
コード例 #6
0
ファイル: FoldedResources.php プロジェクト: ilivanoff/www
 private function assertAdminCanDo($__FUNCTION__, $ident)
 {
     $this->LOGGER->info('{} вызвана для {}', $__FUNCTION__, $ident);
     AuthManager::checkAdminAccess();
 }
コード例 #7
0
ファイル: BaseAudit.php プロジェクト: ilivanoff/www
 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;
 }