X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=locking.php;h=8acdcd70499e41c992bd56c4746b9817c844d41d;hb=ad98b13400fdc2fa2299a22c9bd54c4cd27960c3;hp=09a7cf9513f639b60ebf8c38b72b56760e7812ba;hpb=55c8f6a2bce9518c28337b18823b8300d1875ab8;p=timetracker.git diff --git a/locking.php b/locking.php index 09a7cf95..8acdcd70 100644 --- a/locking.php +++ b/locking.php @@ -31,27 +31,30 @@ import('form.Form'); import('ttTeamHelper'); // Access check. -if (!ttAccessCheck(right_manage_team)) { +if (!ttAccessCheck(right_manage_team) || !$user->isPluginEnabled('lk')) { header('Location: access_denied.php'); exit(); } -$cl_lock_interval = $request->isPost() ? $request->getParameter('lock_interval') : $user->lock_interval; +$cl_lock_spec = $request->isPost() ? $request->getParameter('lock_spec') : $user->lock_spec; $form = new Form('lockingForm'); -$form->addInput(array('type'=>'text','maxlength'=>'10','name'=>'lock_interval','value'=>$cl_lock_interval)); +$form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'lock_spec','style'=>'width: 250px;','value'=>$cl_lock_spec)); $form->addInput(array('type'=>'submit','name'=>'btn_save','value'=>$i18n->getKey('button.save'))); if ($request->isPost()) { - if ($cl_lock_interval == null || trim($cl_lock_interval) == '') $cl_lock_interval = 0; + // Validate user input. + if (!ttValidCronSpec($cl_lock_spec)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.cron_schedule')); - if (ttTeamHelper::update($user->team_id, array( - 'name' => $user->team, - 'locktime' => $cl_lock_interval))) { - header('Location: time.php'); - exit(); - } else { - $err->add($i18n->getKey('error.db')); + if ($err->no()) { + if (ttTeamHelper::update($user->team_id, array( + 'name' => $user->team, + 'lock_spec' => $cl_lock_spec))) { + header('Location: profile_edit.php'); + exit(); + } else { + $err->add($i18n->getKey('error.db')); + } } } // isPost