コード例 #1
0
ファイル: Dog_PrivChannel.php プロジェクト: sinfocol/gwf3
 /**
  * Grant a user all privileges on a server.
  * @param int $sid
  * @param int $uid
  */
 public static function grantAllToAll(Dog_Server $server, Dog_User $user, $bits = NULL)
 {
     $uid = $user->getID();
     $all = $bits === NULL ? Dog_IRCPriv::allBits() : intval($bits);
     foreach (GDO::table('Dog_Channel')->selectColumn('chan_id', "chan_sid={$server->getID()}") as $cid) {
         if (false === self::table(__CLASS__)->insertAssoc(array('priv_cid' => $cid, 'priv_uid' => $uid, 'priv_privs' => $all))) {
             return false;
         }
         $user->setVar("dcp_{$cid}", $all);
     }
     return true;
 }
コード例 #2
0
ファイル: Dog_PrivServer.php プロジェクト: sinfocol/gwf3
 /**
  * Grant all permission on a server to a user.
  * @param int $sid
  * @param int $uid
  * @return boolean
  */
 public static function grantAll(Dog_Server $server, Dog_User $user)
 {
     return self::setPermbits($server, $user, Dog_IRCPriv::allBits());
 }