| @@ -43,12 +43,13 @@ | ||
| 43 | 43 | // operator is logged in (default_dashboard.php) |
| 44 | 44 | $tpl = 'dashboard'; |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | - // turn the permissions into an associative (or empty) array | |
| 47 | + // convert the JSON strings into array values | |
| 48 | 48 | if ($operator) { |
| 49 | - $operator['perms'] = !empty($operator['perms']) ? json_decode($operator['perms'], true) : []; | |
| 50 | - $operator['perms'] = is_array($operator['perms']) ? $operator['perms'] : []; | |
| 49 | + $operator['perms'] = !empty($operator['perms']) ? (is_scalar($operator['perms']) ? (array) json_decode($operator['perms'], true) : $operator['perms']) : []; | |
| 50 | + $operator['work_days_week'] = !empty($operator['work_days_week']) ? (is_scalar($operator['work_days_week']) ? (array) json_decode($operator['work_days_week'], true) : $operator['work_days_week']) : []; | |
| 51 | + $operator['work_days_exceptions'] = !empty($operator['work_days_exceptions']) ? (is_scalar($operator['work_days_exceptions']) ? (array) json_decode($operator['work_days_exceptions'], true) : $operator['work_days_exceptions']) : []; | |
| 51 | 52 | } |
| 52 | 53 | |
| 53 | 54 | $this->operator = $operator; |
| 54 | 55 | $this->tool = $tool; |