Subversion Repositories SmartDukaan

Rev

Rev 13763 | Rev 14019 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 13763 Rev 13900
Line 11... Line 11...
11
 
11
 
12
    public function beforeFilter() {
12
    public function beforeFilter() {
13
    	parent::beforeFilter();
13
    	parent::beforeFilter();
14
    	// $this->Auth->loginRedirect = array('controller' => 'users', 'action' => 'dashboard');
14
    	// $this->Auth->loginRedirect = array('controller' => 'users', 'action' => 'dashboard');
15
    	$this->Auth->loginRedirect = array('controller' => 'pages', 'action' => 'display','home');
15
    	$this->Auth->loginRedirect = array('controller' => 'pages', 'action' => 'display','home');
16
        $this->Auth->allow(array('mine','login', 'forgotten_password', 'register', 'activate', 'checkemail','checkfbuser','registertwitteruser','skipmobileverification','reauthenticate')); 
16
        $this->Auth->allow(array('mine','login', 'forgotten_password', 'register', 'activate', 'checkemail','checkfbuser','registertwitteruser','skipmobileverification','reauthenticate','edit')); 
17
		$this->Cookie->name = 'profittill';
17
		$this->Cookie->name = 'profittill';
18
		$this->Cookie->time = 86400*30; 
18
		$this->Cookie->time = 86400*30; 
19
		$this->Cookie->path = '/';
19
		$this->Cookie->path = '/';
20
		$this->Cookie->key = 'qSI232qs*&sXOw!adre@34SAv!@*(XSL#$%)asGb$@11~_+!@#H23s~#^';
20
		$this->Cookie->key = 'qSI232qs*&sXOw!adre@34SAv!@*(XSL#$%)asGb$@11~_+!@#H23s~#^';
21
		$this->Cookie->httpOnly = true;
21
		$this->Cookie->httpOnly = true;
Line 245... Line 245...
245
 * @param string $id
245
 * @param string $id
246
 * @return void
246
 * @return void
247
 */
247
 */
248
 
248
 
249
    public function edit($id = null) {
249
    public function edit($id = null) {
-
 
250
	$this->log(print_r($this->request->data,1),'mydetails');
250
    	$this->response->type('json');
251
    	$this->response->type('json');
251
		$this->layout = 'ajax';
252
	$this->layout = 'ajax';
252
        $this->User->recursive = -1;
253
	$this->User->recursive = -1;
253
        if (!$this->User->exists($id)) {
254
        if (!$this->User->exists($id)) {
254
			$result = array('success'=>false,'message'=>'Invalid user');
255
		$result = array('success'=>false,'message'=>'Invalid user');
255
		} else {
256
		} else {
256
	        if ($this->request->is('post') || $this->request->is('put')) {
257
	        if ($this->request->is('post') || $this->request->is('put')) {
257
	            if ($this->User->save($this->request->data)) {
258
	            if ($this->User->save($this->request->data)) {
258
	                $result = array('success'=>true,'message'=>'Your profile has been saved');
259
	                $result = array('success'=>true,'message'=>'Your profile has been saved');
259
	            } else {
260
	            } else {