Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Function where $this->_redirect('employees/index'); is defined this is in Application/ControllersIndexController.php
- -------------------------------
- public function loginAction()
- {
- $request = $this->getRequest();
- $form = new Application_Form_Login();
- if ($this->getRequest()->isPost()) {
- if ($form->isValid($_POST)) {
- $EmployeeMapper = new Application_Model_EmployeeMapper();
- $Employee = $EmployeeMapper->findByUsername($form->getValue('username'));
- if ($Employee->isValidLogin($form->getValue('password'))) {
- Zend_Session::regenerateId();
- $this->_sessData->userId = $Employee->employee_id;
- $EmployeePropertyMapper = new Application_Model_EmployeePropertyMapper();
- $PropertyMapper = new Application_Model_PropertyMapper();
- if ($Employee->isAdmin()) {
- $properties = $PropertyMapper->fetchAll();
- if (empty($properties)) {
- $this->_sessData->propertyId = 0;
- $multiple_properties = false;
- }
- else {
- $this->_sessData->propertyId = $properties[0]->property_id;
- $multiple_properties = (count($properties) > 1);
- }
- $this->_sessData->multipleProperties = $multiple_properties;
- }
- else {
- $property_ids = $EmployeePropertyMapper->propertyIdsOfEmployee($Employee->employee_id);
- if (empty($property_ids)) {
- $this->_sessData->propertyId = 0;
- $multiple_properties = false;
- }
- else {
- $this->_sessData->propertyId = $property_ids[0];
- $multiple_properties = (count($property_ids) > 1);
- }
- $this->_sessData->multipleProperties = $multiple_properties;
- }
- $this->_redirect('employees/index');
- }
- else {
- $this->view->error = $Employee->getError();
- }
- }
- }
- $this->view->form = $form;
- }
- -----------------------------------------------
- Request URL:http://projectnir.runcode/internet-items/index
- Request Method:GET
- Status Code:302 Found
- Request Headersview parsed
- GET /internet-items/index HTTP/1.1
- Host: projectnir.runcode
- Connection: keep-alive
- Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
- User-Agent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.63 Safari/537.31
- Referer: http://projectnir.runcode/employees/configurations
- Accept-Encoding: gzip,deflate,sdch
- Accept-Language: en-US,en;q=0.8,te;q=0.6,az;q=0.4
- Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
- Cookie: nir=5klnq7b4ka6n1h2i2t8temqgl3
- Response Headersview parsed
- HTTP/1.1 302 Found
- Date: Fri, 31 May 2013 09:56:51 GMT
- Server: Apache/2.2.22 (Ubuntu)
- X-Powered-By: PHP/5.3.10-1ubuntu3.6
- Expires: Thu, 19 Nov 1981 08:52:00 GMT
- Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
- Pragma: no-cache
- Location: /employees/index
- Vary: Accept-Encoding
- Content-Encoding: gzip
- Content-Length: 20
- Keep-Alive: timeout=5, max=100
- Connection: Keep-Alive
- Content-Type: text/html
- Controller page:
- ------------------
- <?php
- require_once dirname(__FILE__) . '/../../library/Nir/Controller/Action.php';
- class InternetItemsController extends Nir_Controller_Action
- {
- public function init()
- {
- parent::init();
- }
- public function indexAction()
- {
- // action body
- }
- }
- View page in internet-items folder(internet-items/index.phtml)
- ------------------------------------------------------------------
- <br /><br />
- <div id="view-content">
- <p>View script for controller <b>InternetItems</b> and script/action name <b>index</b></p>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement