
authorizeAccesToCP()
By:
TKnapik on
May 4th, 2012 | syntax:
PHP | size: 0.79 KB | hits: 31 | expires: Never
public function authorizeAccesToCP( $group, $character, $redirect = 0 )
{
$query = $this->DB->buildAndFetch(
array(
'select' => 'COUNT(*) AS num_rows',
'from' => GAME_PREFIX . 'rights',
'where' => 'data = ' . intval( $group ) . ' AND uid = ' . intval( $character ) . ' AND (type1 = 1 OR type1 = 2 OR type1 = 3) AND acc = ' . $this->memberData['member_id']
)
);
if( $query['num_rows'] )
{
if( $redirect )
{
$this->registry->output->redirectScreen( 'Pomyślnie zalogowano do panelu grupy.', $this->settings['base_url'] . 'index.php?app=game&module=groupcp§ion=summary&group_id=' . intval( $group ) . '&character_id=' . intval( $character ));
}
}
else
{
$this->registry->output->showError( 'Wystąpił błąd podczas autoryzacji wejścia do panelu.' );
}
}