コード例 #1
0
 public function beforeDelete()
 {
     if (!UserAccess::get()->isCategoryAdmin($this->category_id, $this->category->section_id)) {
         Messages::get()->error("You can't delete this category!");
         return false;
     }
     return parent::beforeDelete();
 }
コード例 #2
0
ファイル: UserGroup.php プロジェクト: mpf-soft/app-basic
 public function beforeDelete()
 {
     App::get()->sql()->table('users2groups')->where('group_id = :group')->setParam(':group', $this->id)->delete();
     //delete connections from this group to users
     return parent::beforeDelete();
 }
コード例 #3
0
 public function beforeDelete()
 {
     if (is_a(App::get(), '\\mpf\\WebApp')) {
         if (!UserAccess::get()->isSectionAdmin($this->section_id)) {
             Messages::get()->error("You don't have access to delete this user group!");
             return false;
         }
     }
     return parent::beforeDelete();
 }
コード例 #4
0
ファイル: User.php プロジェクト: mpf-soft/app-basic
 /**
  * Before deleting user delete every other tables connected to it.
  * @return bool|void
  */
 public function beforeDelete()
 {
     App::get()->sql()->table('users2groups')->where("user_id = :id")->setParam(':id', $this->id)->delete();
     UserHistory::deleteAllByAttributes(['user_id' => $this->id]);
     UserConfig::deleteAllByAttributes(['user_id' => $this->id]);
     return parent::beforeDelete();
 }
コード例 #5
0
ファイル: UserTitle.php プロジェクト: mpf-soft/app-basic
 public function beforeDelete()
 {
     User::updateAll(['title_id' => 0], "title_id = :title", array(':title' => $this->id));
     // update user titles to 0 where this id is used.
     return parent::beforeDelete();
 }