mirror of
https://github.com/urlgrey/hsmm-pi
synced 2025-10-06 00:12:53 +02:00
Fix deprecations.
This commit is contained in:
@@ -11,7 +11,7 @@ class LocationSettingsController extends AppController {
|
||||
}
|
||||
|
||||
$this->set('location_source', $location['LocationSetting']['location_source']);
|
||||
if ($this->request->isPost() || $this->request->isPut()) {
|
||||
if ($this->request->is('post') || $this->request->is('put')) {
|
||||
if ($this->LocationSetting->save($this->request->data)) {
|
||||
$latest_location = $this->get_location();
|
||||
$network_setting = $this->get_network_settings();
|
||||
@@ -50,4 +50,4 @@ class LocationSettingsController extends AppController {
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
@@ -10,7 +10,7 @@ class NetworkSettingsController extends AppController {
|
||||
throw new NotFoundException(__('Invalid setting'));
|
||||
}
|
||||
|
||||
if ($this->request->isPost() || $this->request->isPut()) {
|
||||
if ($this->request->is('post') || $this->request->is('put')) {
|
||||
if ($this->NetworkSetting->save($this->request->data)) {
|
||||
$latest_network_setting = $this->get_network_settings();
|
||||
$network_services = $this->get_network_services();
|
||||
@@ -151,4 +151,3 @@ no-dhcp-interface=" . $network_setting['NetworkSetting']['wifi_adapter_name'];
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
|
@@ -12,7 +12,7 @@ class UsersController extends AppController {
|
||||
|
||||
if ($this->Auth->login()) {
|
||||
$this->Session->setFlash(__('Login successful, carry on'), 'default', array('class' => 'alert alert-success'));
|
||||
$this->redirect($this->Auth->redirect());
|
||||
$this->redirect($this->Auth->redirectUrl());
|
||||
} else {
|
||||
$this->Session->setFlash(__('Invalid username or password, try again'), 'default', array('class' => 'alert alert-error'));
|
||||
}
|
||||
@@ -31,7 +31,7 @@ class UsersController extends AppController {
|
||||
|
||||
if ($admin_user == null) {
|
||||
$this->Session->setFlash(__('Unable to find user account, this should never happen'), 'default', array('class' => 'alert alert-error'));
|
||||
} else if (strcmp($admin_user['User']['password'], AuthComponent::password($this->request->data['User']['current_password'])) != 0) {
|
||||
} else if (strcmp($admin_user['User']['password'], Security::hash($this->request->data['User']['current_password'], null, true)) != 0) {
|
||||
$this->Session->setFlash(__('The current password was incorrect'), 'default', array('class' => 'alert alert-error'));
|
||||
} else if (strcmp($this->request->data['User']['password'], $this->request->data['User']['password_confirmation']) != 0) {
|
||||
$this->Session->setFlash(__('New passwords did not match'), 'default', array('class' => 'alert alert-error'));
|
||||
|
@@ -11,7 +11,7 @@ class User extends AppModel {
|
||||
|
||||
public function beforeSave($options = array()) {
|
||||
if (isset($this->data[$this->alias]['password'])) {
|
||||
$this->data[$this->alias]['password'] = AuthComponent::password($this->data[$this->alias]['password']);
|
||||
$this->data[$this->alias]['password'] = Security::hash($this->data[$this->alias]['password'], null, true);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user