Esempio n. 1
0
if (isset($_POST['UpdateUsers'])) {
    $definition = array('max_operators' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'int'), 'one_per_account' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'boolean'));
    $form = new ezcInputForm(INPUT_POST, $definition);
    $Errors = array();
    if ($form->hasValidData('one_per_account') && $form->one_per_account == true) {
        $Instance->one_per_account = 1;
    } else {
        $Instance->one_per_account = 0;
    }
    if ($form->hasValidData('max_operators')) {
        $Instance->max_operators = $form->max_operators;
    } else {
        $Instance->max_operators = 0;
    }
    $Instance->saveThis();
    erLhcoreClassInstance::performOperatorsLimit($Instance);
    $tpl->set('updated', true);
}
if (isset($_POST['UpdateAttributes'])) {
    $definition = array('DateFormat' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'string'), 'DateHourFormat' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'string'), 'DateAndHourFormat' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'string'), 'UserTimeZone' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'string'), 'FrontSiteaccess' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'string'), 'Language' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'string'), 'UserTimeZone' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'string'));
    $form = new ezcInputForm(INPUT_POST, $definition);
    $Errors = array();
    if ($form->hasValidData('Language')) {
        $Instance->locale = $form->Language;
    }
    if ($form->hasValidData('DateFormat')) {
        $Instance->date_format = $form->DateFormat;
    }
    if ($form->hasValidData('DateHourFormat')) {
        $Instance->date_hour_format = $form->DateHourFormat;
    }