Пример #1
0
        }

        // Adjust max hourly rate so that it's not greater than the global max hourly rate
        if (SENDSTUDIO_MAXHOURLYRATE > 0) {
            if ($user->Get('perhour') == 0 || ($user->Get('perhour') > SENDSTUDIO_MAXHOURLYRATE)) {
                $user_hourly = $this->FormatNumber($user->Get('perhour'));
                if ($user->Get('perhour') == 0) {
                    $user_hourly = GetLang('UserPerHour_Unlimited');
                }
                $warnings[] = sprintf(GetLang('UserPerHourOverMaxHourlyRate'), $this->FormatNumber(SENDSTUDIO_MAXHOURLYRATE), $user_hourly);
            }
        }

        // Set permissions only if supplied
        if (!empty($function_params['permissions'])) {
            $user->RevokeAccess();
            foreach ($function_params['permissions'] as $area => $p) {
                foreach ($p as $subarea => $k) {
                    $user->GrantAccess($area, $subarea);
                }
            }
        }

        // Check if we need to grant extra list access to the user
        if (isset($function_params['lists'])) {
            $user->RevokeListAccess();

            $access = array();
            if (!is_array($function_params['lists'])) {
                $access[$function_params['lists']] = 1;
            } else {