Merge pull request #343 from TheSerapher/issue-339

Fixing PHP warnings on account workers page
This commit is contained in:
Sebastian Grewe 2013-07-02 12:10:39 -07:00
commit cdbb70775a
2 changed files with 5 additions and 2 deletions

View File

@ -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) {

View File

@ -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');