Don't like ads? PRO users don't see any ads ;-)

authorizeAccesToCP()

By: TKnapik on May 4th, 2012  |  syntax: PHP  |  size: 0.79 KB  |  hits: 31  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. public function authorizeAccesToCP( $group, $character, $redirect = 0 )
  2. {              
  3.         $query = $this->DB->buildAndFetch(
  4.                 array(
  5.                         'select'        =>      'COUNT(*) AS num_rows',
  6.                         'from'  =>      GAME_PREFIX . 'rights',
  7.                         'where' =>      'data = ' . intval( $group ) . ' AND uid = ' . intval( $character ) . ' AND (type1 = 1 OR type1 = 2 OR type1 = 3) AND acc = ' . $this->memberData['member_id']
  8.                 )
  9.         );
  10.        
  11.         if( $query['num_rows'] )
  12.         {
  13.                 if( $redirect )
  14.                 {
  15.                         $this->registry->output->redirectScreen( 'Pomyślnie zalogowano do panelu grupy.', $this->settings['base_url'] . 'index.php?app=game&module=groupcp&section=summary&group_id=' . intval( $group ) . '&character_id=' . intval( $character ));
  16.                 }
  17.         }
  18.         else
  19.         {
  20.                 $this->registry->output->showError( 'Wystąpił błąd podczas autoryzacji wejścia do panelu.' );
  21.         }
  22. }