function deleteItem(struct_core_settings $struct = NULL) { if ($struct->getPrimaryKey()) { return $this->delete_struct($struct, RAD . 'settings'); } else { return 0; } }
public static function clearParams($params) { $result = false; if (count($params)) { foreach ($params as $id => $param) { $res = rad_dbpdo::queryAll('select * from ' . RAD . 'settings WHERE fldName LIKE :param', array('param' => $param)); if (count($res)) { foreach ($res as $id) { $item = new struct_core_settings($id); $item->remove(); $result = true; } } } } return $result; }
protected function _testSaveTabernaLP() { $result = array(); if ($this->post('l') and $this->post('p')) { $user = rad_instances::get('model_coresession_taberna')->login($this->post('l'), $this->post('p')); if (!$user) { $result['code'] = '1'; //CODE_USER_NOT_FOUND } elseif (is_int($user)) { switch ($user) { case 9: //USER ID BLOCKD $result['code'] = 9; break; default: //UNKNOWN CODE $result['code'] = 1000; break; } } else { $result['code'] = '8'; $result['user'] = $user->user; $result['menu'] = $this->_parseMenu($user); $result['i18'] = $this->_geti18(); $itemUser = new struct_core_settings(array('fldName' => 'taberna.user', 'fldValue' => $this->post('l'), 'rtype' => 'system')); $itemUser->save(); $itemPass = new struct_core_settings(array('fldName' => 'taberna.pass', 'fldValue' => $this->post('p'), 'rtype' => 'system')); $itemPass->save(); } } else { $this->redirect('404'); } $this->header('Content-Type: text/javascript'); die(json_encode($result)); }