Merge pull request #343 from TheSerapher/issue-339
Fixing PHP warnings on account workers page
This commit is contained in:
commit
cdbb70775a
@ -42,6 +42,10 @@ class Worker {
|
||||
**/
|
||||
public function updateWorkers($account_id, $data) {
|
||||
$this->debug->append("STA " . __METHOD__, 4);
|
||||
if (!is_array($data)) {
|
||||
$this->setErrorMessage('No workers to update');
|
||||
return false;
|
||||
}
|
||||
$username = $this->user->getUserName($account_id);
|
||||
$iFailed = 0;
|
||||
foreach ($data as $key => $value) {
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
// Make sure we are called from index.php
|
||||
if (!defined('SECURITY')) die('Hacking attempt');
|
||||
|
||||
@ -20,7 +19,7 @@ if ($user->isAuthenticated()) {
|
||||
}
|
||||
break;
|
||||
case 'update':
|
||||
if ($worker->updateWorkers($_SESSION['USERDATA']['id'], $_POST['data'])) {
|
||||
if ($worker->updateWorkers($_SESSION['USERDATA']['id'], @$_POST['data'])) {
|
||||
$_SESSION['POPUP'][] = array('CONTENT' => 'Worker updated');
|
||||
} else {
|
||||
$_SESSION['POPUP'][] = array('CONTENT' => $worker->getError(), 'TYPE' => 'errormsg');
|
||||
|
||||
Loading…
Reference in New Issue
Block a user