Subversion Repositories SmartDukaan

Rev

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

Rev 14150 Rev 14300
Line 256... Line 256...
256
 * @return void
256
 * @return void
257
 */
257
 */
258
 
258
 
259
    public function edit($id = null) {
259
    public function edit($id = null) {
260
	$this->log(print_r($this->request->data,1),'mydetails');
260
	$this->log(print_r($this->request->data,1),'mydetails');
261
    	$this->response->type('json');
261
	$this->response->type('json');
262
	$this->layout = 'ajax';
262
	$this->layout = 'ajax';
263
	$this->User->recursive = -1;
263
	$this->User->recursive = -1;
264
        if (!$this->User->exists($id)) {
264
        if (!$this->User->exists($id)) {
265
		$result = array('success'=>false,'message'=>'Invalid user');
265
			$result = array('success'=>false,'message'=>'Invalid user');
266
		} else {
266
		} else {
267
	        if ($this->request->is('post') || $this->request->is('put')) {
267
	        if ($this->request->is('post') || $this->request->is('put')) {
-
 
268
	        	if(!empty($this->request->data['mobile_number'])){
-
 
269
	        		$this->request->data['mobile_verified'] = 0;
-
 
270
	        	}
268
	            if ($this->User->save($this->request->data)) {
271
	            if ($this->User->save($this->request->data)) {
269
	                $result = array('success'=>true,'message'=>'Your profile has been saved');
272
	                $result = array('success'=>true,'message'=>'Your profile has been saved');
270
	            } else {
273
	            } else {
271
	                $result = array('success'=>false,'message'=> 'The user could not be saved. Please, try again.');
274
	                $result = array('success'=>false,'message'=> 'The user could not be saved. Please, try again.');
272
	            }
275
	            }