public function addapp($params) { if (!isset($_SESSION['id']) || !isset($_GET['appUrl'])) { header("Location: /"); } $url = trim(urldecode($_GET['appUrl'])); $apps = $this->model('applications'); $ret = $apps->add_application($_SESSION['id'], $url); if ($ret['app_id'] && $ret['mod_id'] && !$ret['error']) { // App added ok, goto app settings header("Location: " . PartuzaConfig::get("web_prefix") . "/profile/application/{$_SESSION['id']}/{$ret['app_id']}/{$ret['mod_id']}"); } else { // Using the home controller to display the error on the person's home page include_once PartuzaConfig::get('controllers_root') . "/home/home.php"; $homeController = new homeController(); $message = "<b>Could not add application:</b><br/> {$ret['error']}"; $homeController->index($params, $message); } }