function action() { $auth =& owa_auth::get_instance(); $status = $auth->authenticateUser(); $go = $this->getParam('go'); // if authentication is successfull if ($status['auth_status'] == true) { if (!empty($go)) { // redirect to url if present $url = urldecode($go); $this->e->debug("redirecting browser to...:" . $url); owa_lib::redirectBrowser($url); } else { //else redirect to home page // these need to be unset as they were set previously by the doAction method. // need to refactor this out. $this->set('auth_status', ''); $this->set('params', ''); $this->set('site_id', ''); $this->setRedirectAction($this->config['start_page']); } } else { // return login form with error msg $this->setView('base.loginForm'); $this->set('go', $go); $this->set('error_code', 2002); $this->set('user_id', $this->getParam('user_id')); } }
// See the License for the specific language governing permissions and // limitations under the License. // // $Id$ // require_once 'owa_env.php'; require_once OWA_DIR . 'owa_php.php'; /** * Main Admin Page Wrapper Script * * @author Peter Adams <*****@*****.**> * @copyright Copyright © 2006 Peter Adams <*****@*****.**> * @license http://www.gnu.org/copyleft/gpl.html GPL v2.0 * @category owa * @package owa * @version $Revision$ * @since owa 1.0.0 */ // Initialize owa admin $owa = new owa_php(); if (!$owa->isOwaInstalled()) { // redirect to install owa_lib::redirectBrowser(owa_coreAPI::getSetting('base', 'public_url') . 'install.php'); } if ($owa->isEndpointEnabled(basename(__FILE__))) { // run controller or view and echo page content echo $owa->handleRequestFromURL(); } else { // unload owa $owa->restInPeace(); }
/** * redirects borwser to a particular view * * @param unknown_type $data */ public static function redirectToView($data) { //print_r($data); $c = owa_coreAPI::configSingleton(); $config = $c->fetch('base'); $control_params = array('view_method', 'auth_status'); $get = ''; foreach ($data as $n => $v) { if (!in_array($n, $control_params)) { $get .= $config['ns'] . $n . '=' . $v . '&'; } } $new_url = sprintf($config['link_template'], $config['main_url'], $get); owa_lib::redirectBrowser($new_url); }
function redirectBrowserToUrl($url) { return owa_lib::redirectBrowser($url); }
ignore_user_abort(true); // turn off gzip compression if (function_exists('apache_setenv')) { apache_setenv('no-gzip', 1); } ini_set('zlib.output_compression', 0); // turn on output buffering if necessary if (ob_get_level() == 0) { ob_start(); } // removing any content encoding like gzip etc. header('Content-encoding: none', true); //check to se if request is a POST if ($_SERVER['REQUEST_METHOD'] === 'POST') { // redirect to blank.php owa_lib::redirectBrowser(str_replace('log.php', 'blank.php', owa_lib::get_current_url())); // necessary or else buffer is not actually flushed echo ' '; } else { // return 1x1 pixel gif header("Content-type: image/gif"); // needed to avoid cache time on browser side header("Content-Length: 42"); header("Cache-Control: private, no-cache, no-cache=Set-Cookie, proxy-revalidate"); header("Expires: Wed, 11 Jan 2000 12:59:00 GMT"); header("Last-Modified: Wed, 11 Jan 2006 12:59:00 GMT"); header("Pragma: no-cache"); echo sprintf('%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%', 71, 73, 70, 56, 57, 97, 1, 0, 1, 0, 128, 255, 0, 192, 192, 192, 0, 0, 0, 33, 249, 4, 1, 0, 0, 0, 0, 44, 0, 0, 0, 0, 1, 0, 1, 0, 0, 2, 2, 68, 1, 0, 59); } // flush all output buffers. No reason to make the user wait for OWA. ob_flush();