Example #1
0
 /**
  * (non-PHPdoc)
  * @see lib/controllers/Controller::getContents()
  */
 public function getContents()
 {
     Application::addStylesheet("css/permissions.css");
     $menu = unserialize(file_get_contents("app/cache/menus/menu_{$_SESSION["role_id"]}.object"));
     $menu = $menu["/{$_GET["q"]}"];
     $return = "<h2>{$menu["title"]}</h2>";
     $return .= $this->getChildren($menu) . "<div style='clear:both'></div>";
     return "<div id='permissions'>{$return}</div>";
 }
Example #2
0
 /**
  * The default page which shows the login form.
  * @see lib/controllers/Controller#getContents()
  */
 public function getContents()
 {
     Application::addStylesheet("css/login.css");
     Application::$template = "login.tpl";
     Application::setTitle("Login");
     if ($_SESSION["logged_in"]) {
         Application::redirect(Application::getLink("/"));
     }
     $form = new Form();
     $form->setRenderer("default");
     $username = new TextField("Username", "username");
     $form->add($username);
     $password = new PasswordField("Password", "password");
     $form->add($password);
     $form->setSubmitValue("Login");
     $form->setCallback("{$this->getClassName()}::callback", $this);
     return $form->render();
 }
Example #3
0
 public function getContents()
 {
     //          if(Configuration::get('attempt_counter') == null || Configuration::get('attempt_counter') === '0')
     //        {
     //            Configuration::set('attempt_counter',0);
     //        }
     Application::addStylesheet("css/login.css");
     Application::$template = "login.tpl";
     Application::setTitle("Login");
     if ($_SESSION["logged_in"]) {
         Application::redirect("/");
     }
     $form = new Form();
     $form->setRenderer("default");
     $username = new TextField("Username", "username");
     $form->add($username);
     $password = new PasswordField("Password", "password");
     $password->setEncrypted(false);
     $form->add($password);
     $form->setSubmitValue("Login");
     $form->setValidatorCallback("{$this->getClassName()}::callback");
     $form->setShowClear(false);
     return $form->render();
 }
Example #4
0
                    $i++;
                }
                $item = str_replace("_", " ", $item);
                $item = ucwords($item);
                $top_menu .= "<a href='" . Application::getLink($link) . "'><span>{$item}</span></a>";
            }
            Application::$templateEngine->assign('top_menu', $top_menu);
        }
    }
}
// Log the route into the audit trail if it is enabled
if ($_SESSION['logged_in'] == true && $_GET['q'] != 'system/api/table' && ENABLE_AUDIT_TRAILS === true) {
    $data = json_encode(array('route' => $_GET['q'], 'request' => $_REQUEST, 'get' => $_GET, 'post' => $_POST));
    if (class_exists("SystemAuditTrailModel", false) && ENABLE_ROUTING_TRAILS === true) {
        SystemAuditTrailModel::log(array('item_id' => '0', 'item_type' => 'routing_activity', 'description' => "Accessed [{$_GET['q']}]", 'type' => SystemAuditTrailModel::AUDIT_TYPE_ROUTING, 'data' => $data));
    }
}
// Load the styleseets and the javascripts
if ($GLOBALS['fapi_stylesheet'] === false) {
    Application::preAddStylesheet("css/fapi.css", Application::getWyfHome("fapi/"));
} else {
    Application::preAddStylesheet($GLOBALS['fapi_stylesheet']);
}
Application::preAddStylesheet("kalendae/kalendae.css", Application::getWyfHome('assets/js/'));
Application::preAddStylesheet("css/main.css");
Application::addStylesheet('css/rapi.css', Application::getWyfHome('rapi/'));
Application::addJavaScript(Application::getLink(Application::getWyfHome("fapi/js/fapi.js")));
Application::addJavaScript(Application::getLink(Application::getWyfHome("assets/js/jquery.js")));
Application::addJavaScript(Application::getLink(Application::getWyfHome("assets/js/kalendae/kalendae.js")));
// Blast the HTML code to the browser!
Application::render();
Example #5
0
                $item = $top_menu_items[$i];
                $link .= "/" . $item;
                while (is_numeric($top_menu_items[$i + 1])) {
                    $link .= "/" . $top_menu_items[$i + 1];
                    $i++;
                }
                $item = str_replace("_", " ", $item);
                $item = ucwords($item);
                $top_menu .= " <a href='" . Application::getLink($link) . "'><span>{$item}</span></a>";
            }
            $t->assign('top_menu', $top_menu);
        }
    }
    // Log the route into the audit trail if it is enabled
    if ($_SESSION['logged_in'] == true && $_GET['q'] != 'system/api/table' && ENABLE_AUDIT_TRAILS === true) {
        $data = json_encode(array('route' => $_GET['q'], 'request' => $_REQUEST, 'get' => $_GET, 'post' => $_POST));
        if (class_exists("SystemAuditTrailModel", false) && ENABLE_ROUTING_TRAILS === true) {
            SystemAuditTrailModel::log(array('item_id' => '0', 'item_type' => 'routing_activity', 'description' => "Accessed [{$_GET['q']}]", 'type' => SystemAuditTrailModel::AUDIT_TYPE_ROUTING, 'data' => $data));
        }
    }
    // Load the styleseets and the javascripts
    Application::addStylesheet("css/fapi.css", "lib/fapi/");
    Application::addStylesheet("css/main.css");
    Application::addJavaScript(Application::getLink("/lib/fapi/js/fapi.js"));
    Application::addJavaScript(Application::getLink("/lib/js/jquery.js"));
    Application::addJavaScript(Application::getLink("/lib/js/jquery-ui.js"));
    Application::addJavaScript(Application::getLink("/lib/js/json2.js"));
    // Blast the HTML code to the browser!
    Application::$site_name = Application::$config['name'];
    Application::render();
}