function LoginAction() { // Validate login $where = array("login = '******'login'] . "'", "password = '******'password'] . "'"); if ($userInfo = Query::SingleRow($this->name, $where)) { // Login succeeded; create cookie and reload this page $_JAM->user->Login($userInfo['id']); HTTP::ReloadCurrentURL(); } else { // Login failed } }
function Connect() { global $_JAM; // Check whether user has submitted the login form if ($_POST['connect']) { // Validate login $where = array("login = '******'login'] . "'", "password = '******'password'] . "'"); if ($userInfo = Query::SingleRow('users', $where)) { // Login succeeded; create cookie and reload this page $this->Login($userInfo['id']); HTTP::ReloadCurrentURL(); return true; } else { print e('p', array('class' => 'error'), $_JAM->strings['admin']['incorrectLogin']); } } // Display form if login was incorrect or user has not yet submitted the form $form = new Form(); $form->Open(); print $form->Field('login', 40, $_JAM->strings['admin']['login']); print $form->Password('password', 40, $_JAM->strings['admin']['password']); print $form->Submit('connect', $_JAM->strings['admin']['connect']); $form->Close(); }
function AdminRevertViewController() { global $_JAM; // Fetch data for this specific version $revertID = $_GET['revertid']; $data = Query::SingleRow($this->nestedModule->name, 'id = ' . $revertID); // Load data into module $this->nestedModule->LoadData($data); // Display friendly UI $masterID = $this->nestedModule->item['master'] ? $this->nestedModule->item['master'] : $this->nestedModule->item['id']; $this->nestedModule->view['backLink'] = a('admin/' . $this->nestedModule->name . '?a=old&id=' . $masterID, $_JAM->strings['admin']['backRevert']); $this->nestedModule->view['masterID'] = $masterID; $this->nestedModule->view['revertID'] = $revertID; $this->nestedModule->view['message'] = $_JAM->strings['admin']['revertConfirmation']; // Build confirmation form $this->nestedModule->view['confirmForm'] = new Form(); }
private function load() { $q = new Query("select r.*,\n unix_timestamp(r.endtime) as ends,\n unix_timestamp(r.starttime) as starts,\n unix_timestamp(r.endtime) - unix_timestamp(starttime) as duration,\n ch.name as channel_name,\n (select max(mark) \n from recordedseek s\n where s.starttime = r.starttime\n and s.chanid = r.chanid) as maxmark\n from recorded r\n left join channel ch on (ch.chanid=r.chanid)\n where r.chanid = :chanid\n and r.starttime = :starttime"); $q->chanid = $this->chanid; $q->starttime = date('Y-m-d H:i:s', $this->starttime); $r = $q->SingleRow(); $this->loaded = $r->chanid != ''; if ($this->isLoaded()) { $this->moviedata = $r; } }