コード例 #1
0
 /**
  * Rename group
  */
 public function renameGroup($p)
 {
     if (!User::isVerified()) {
         return array('success' => false, 'verify' => true);
     }
     $title = Purify::humanName($p['title']);
     if (empty($title)) {
         throw new \Exception(L\get('Wrong_input_data'));
     }
     $id = $this->extractId($p['id']);
     if (!Security::canEditUser($id)) {
         throw new \Exception(L\get('Access_denied'));
     }
     DB\dbQuery('UPDATE users_groups
         SET name = $2, uid = $3
         WHERE id = $1 AND type = 1', array($id, $title, $_SESSION['user']['id'])) or die(DB\dbQueryError());
     return array('success' => true, 'title' => $title);
 }