Changeset 6852
- Timestamp:
- 07/23/12 18:05:48 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.4/prototype/api/esecurity.php
r6829 r6852 1 1 <?php 2 2 3 require_once(__DIR__.'/controller.php'); 3 require_once(__DIR__.'/config.php'); 4 5 use prototype\api\Config as Config; 4 6 5 7 class ESecurity … … 12 14 { 13 15 $sql = 'SELECT config_value FROM phpgw_config WHERE config_app = \'phpgwapi\' AND config_name = \'webserver_url\''; 14 $params = Controller::service('PostgreSQL')->execResultSql($sql); 16 $config = Config::service('PostgreSQL' , 'config'); 17 18 $rs = ''; 19 $rs .= ( isset($config['host']) && $config['host'] ) ? ' host='.$config['host'] : '' ; 20 $rs .= ( isset($config['user']) && $config['user'] ) ? ' user='.$config['user'] : '' ; 21 $rs .= ( isset($config['password']) && $config['password'] ) ? ' password='.$config['password'] : '' ; 22 $rs .= ( isset($config['dbname']) && $config['dbname'] ) ? ' dbname='.$config['dbname'] : '' ; 23 $rs .= ( isset($config['port']) && $config['port'] ) ? ' port='.$config['port'] : '' ; 24 25 $con = pg_connect( $rs ); 26 $rs = pg_query( $con, $sql ); 27 $row = pg_fetch_assoc( $rs ); 28 15 29 session_destroy(); 16 header( 'Location: '.$ params[0]['config_value'].'/login.php' );30 header( 'Location: '.$row['config_value'].'/login.php' ); 17 31 die(); 18 32 }
Note: See TracChangeset
for help on using the changeset viewer.