/** * Login page and submission */ public function index() { // Login form $this->load->library('form_builder'); $form = $this->form_builder->create_form('admin/login'); $form->add_text('username', '', 'Username', 'admin'); $form->add_password('password', '', 'Password', 'admin'); $form->add_submit('Sign In', 'primary', TRUE); if (!empty($this->input->post()) && $form->validate()) { // passed validation $username = $this->input->post('username'); $password = $this->input->post('password'); $this->load->model('admin_user_model', 'users'); $user = $this->users->login($username, $password); if (empty($user)) { // login failed set_alert('danger', 'Invalid Login'); refresh(); } else { // login success $this->session->set_userdata('admin_user', $user); redirect('admin'); } } // display form when no POST data, or validation failed $this->mViewData['form'] = $form; $this->mBodyClass = 'login-page'; $this->render('login', 'empty'); }
public function _edit($team_id, $name, $title, $image_id, $icon_id, $description, $game_id) { $users = $this->db->select('u.user_id', 'u.username', 'tu.user_id IS NOT NULL AS in_team')->from('nf_users u')->join('nf_teams_users tu', 'tu.user_id = u.user_id AND tu.team_id = ' . $team_id)->join('nf_teams_roles r', 'r.role_id = tu.role_id')->where('u.deleted', FALSE)->order_by('r.order', 'r.role_id', 'u.username')->get(); $roles = $this->model('roles')->get_roles(); $form_team = $this->title($this('edit_team'))->subtitle($title)->load->library('form')->add_rules('teams', array('title' => $title, 'game_id' => $game_id, 'games' => $this->model()->get_games_list(), 'image_id' => $image_id, 'icon_id' => $icon_id, 'description' => $description))->add_submit($this('edit'))->add_back('admin/teams.html')->save(); $form_users = $this->form->add_rules(array('user_id' => array('type' => 'select', 'values' => array_filter(array_map(function ($a) { return !$a['in_team'] ? $a['user_id'] : NULL; }, $users)), 'rules' => 'required'), 'role_id' => array('type' => 'select', 'values' => array_map(function ($a) { return $a['role_id']; }, $roles), 'rules' => 'required')))->save(); if ($form_team->is_valid($post)) { $this->model()->edit_team($team_id, $post['title'], $post['game'], $post['image'], $post['icon'], $post['description']); //add_alert('success', $this('edit_team_success_message')); redirect_back('admin/teams.html'); } else { if ($form_users->is_valid($post)) { $this->db->insert('nf_teams_users', array('team_id' => $team_id, 'user_id' => $post['user_id'], 'role_id' => $post['role_id'])); refresh(); } } $this->load->library('table')->add_columns(array(array('content' => function ($data) { return NeoFrag::loader()->user->link($data['user_id'], $data['username']); }), array('content' => function ($data) { return $data['title']; }), array('content' => array(function ($data) use($team_id, $name) { return button_delete('admin/teams/players/delete/' . $team_id . '/' . $name . '/' . $data['user_id'] . '.html'); }), 'size' => TRUE)))->pagination(FALSE)->data($this->db->select('tu.user_id', 'u.username', 'r.title')->from('nf_teams_users tu')->join('nf_users u', 'u.user_id = tu.user_id')->join('nf_teams_roles r', 'r.role_id = tu.role_id')->where('tu.team_id', $team_id)->order_by('r.title', 'u.username')->get())->no_data($this('no_players_on_team')); return new Row(new Col(new Panel(array('title' => $this('edit_team'), 'icon' => 'fa-gamepad', 'content' => $form_team->display(), 'size' => 'col-md-12 col-lg-7'))), new Col(new Panel(array('title' => $this('players'), 'icon' => 'fa-users', 'content' => $this->table->display(), 'footer' => $this->load->view('users', array('users' => $users, 'roles' => $roles, 'form_id' => $form_users->id)), 'size' => 'col-md-12 col-lg-5')))); }
/** * Login page and submission */ public function index() { $this->load->library('form_builder'); $form = $this->form_builder->create_form(); if ($form->validate()) { // passed validation $identity = $this->input->post('username'); $password = $this->input->post('password'); $remember = $this->input->post('remember') == 'on'; if ($this->ion_auth->login($identity, $password, $remember)) { // login succeed $messages = $this->ion_auth->messages(); $this->system_message->set_success($messages); redirect('admin'); } else { // login failed $errors = $this->ion_auth->errors(); $this->system_message->set_error($errors); refresh(); } } // display form when no POST data, or validation failed $this->mViewData['body_class'] = 'login-page'; $this->mViewData['form'] = $form; $this->mBodyClass = 'login-page'; $this->render('login', 'empty'); }
/** * Login page and submission */ public function index() { $this->load->library('form_builder'); $form = $this->form_builder->create_form(); if ($form->validate()) { // passed validation $username = $this->input->post('username'); $password = $this->input->post('password'); $this->load->model('admin_user_model', 'users'); $user = $this->users->login($username, $password); if (empty($user)) { // login failed $this->system_message->set_error('Invalid Login'); refresh(); } else { // login success $this->session->set_userdata('admin_user', $user); redirect('admin'); } } // display form when no POST data, or validation failed $this->mViewData['body_class'] = 'login-page'; $this->mViewData['form'] = $form; $this->mBodyClass = 'login-page'; $this->render('login', 'empty'); }
function DB_copy($table, $fields, $values, $tablefrom, $id, $value, $return_page = '') { global $_DB; $_DB->dbCopy($table, $fields, $values, $tablefrom, $id, $value); if (!empty($return_page)) { print refresh("{$return_page}"); } }
public function index($theme) { $this->css('admin')->js('admin'); $form_header = $this->load->library('form')->add_rules(array('header' => array('label' => 'Image de fond', 'value' => $this->config->{'dungeon_header'}, 'type' => 'file', 'upload' => 'themes/dungeon/headers', 'info' => ' d\'image (max. ' . file_upload_max_size() / 1024 / 1024 . ' Mo)', 'check' => function ($filename, $ext) { if (!in_array($ext, array('gif', 'jpeg', 'jpg', 'png'))) { return 'Veuiller choisir un fichier d\'image'; } }, 'description' => 'Laisser vide pour utiliser l\'image par défaut du thème.'), 'repeat' => array('label' => 'Répéter l\'image', 'value' => $this->config->dungeon_header_repeat, 'values' => array('no-repeat' => 'Non', 'repeat-x' => 'Horizontalement', 'repeat-y' => 'Verticalement', 'repeat' => 'Les deux'), 'type' => 'radio', 'rules' => 'required'), 'positionX' => array('label' => 'Position', 'value' => explode(' ', $this->config->dungeon_header_position)[0], 'values' => array('left' => 'Gauche', 'center' => 'Centré', 'right' => 'Droite'), 'type' => 'radio', 'rules' => 'required'), 'positionY' => array('value' => explode(' ', $this->config->dungeon_header_position)[1], 'values' => array('top' => 'Haut', 'center' => 'Milieu', 'bottom' => 'Bas'), 'type' => 'radio', 'rules' => 'required'), 'fixed' => array('checked' => array('on' => $this->config->dungeon_header_attachment == 'fixed'), 'values' => array('on' => 'Image fixe'), 'type' => 'checkbox'), 'color' => array('label' => 'Couleur de fond', 'value' => $this->config->dungeon_header_color, 'type' => 'colorpicker', 'rules' => 'required'), 'logo' => array('label' => 'Logo du site', 'value' => $this->config->dungeon_logo, 'type' => 'file', 'upload' => 'themes/dungeon/logos', 'info' => ' d\'image (max. ' . file_upload_max_size() / 1024 / 1024 . ' Mo)', 'check' => function ($filename, $ext) { if (!in_array($ext, array('gif', 'jpeg', 'jpg', 'png'))) { return 'Veuiller choisir un fichier d\'image'; } }, 'description' => 'Le logo sera affiché dans le widget type "header", en remplacement du titre et slogan.')))->add_submit('Enregistrer')->save(); $form_background = $this->form->add_rules(array('background' => array('label' => 'Image de fond', 'value' => $this->config->dungeon_background, 'type' => 'file', 'upload' => 'themes/dungeon/backgrounds', 'info' => ' d\'image (max. ' . file_upload_max_size() / 1024 / 1024 . ' Mo)', 'check' => function ($filename, $ext) { if (!in_array($ext, array('gif', 'jpeg', 'jpg', 'png'))) { return 'Veuiller choisir un fichier d\'image'; } }, 'description' => 'Laisser vide pour utiliser l\'image par défaut du thème.'), 'repeat' => array('label' => 'Répéter l\'image', 'value' => $this->config->dungeon_background_repeat, 'values' => array('no-repeat' => 'Non', 'repeat-x' => 'Horizontalement', 'repeat-y' => 'Verticalement', 'repeat' => 'Les deux'), 'type' => 'radio', 'rules' => 'required'), 'positionX' => array('label' => 'Position', 'value' => explode(' ', $this->config->dungeon_background_position)[0], 'values' => array('left' => 'Gauche', 'center' => 'Centré', 'right' => 'Droite'), 'type' => 'radio', 'rules' => 'required'), 'positionY' => array('value' => explode(' ', $this->config->dungeon_background_position)[1], 'values' => array('top' => 'Haut', 'center' => 'Milieu', 'bottom' => 'Bas'), 'type' => 'radio', 'rules' => 'required'), 'fixed' => array('checked' => array('on' => $this->config->dungeon_background_attachment == 'fixed'), 'values' => array('on' => 'Image fixe'), 'type' => 'checkbox'), 'color' => array('label' => 'Couleur de fond', 'value' => $this->config->dungeon_background_color, 'type' => 'colorpicker', 'rules' => 'required')))->add_submit('Enregistrer')->save(); $form_settings = $this->form->add_rules(array('theme_color' => array('label' => 'Couleur du thème', 'value' => $this->config->dungeon_theme_color, 'type' => 'colorpicker', 'description' => 'Couleur générale du thème', 'rules' => 'required'), 'font_color' => array('label' => 'Couleur du texte', 'value' => $this->config->dungeon_font_color, 'type' => 'colorpicker', 'description' => 'Couleur appliquée au texte principal du thème', 'rules' => 'required'), 'font_size' => array('label' => 'Taille du texte', 'value' => $this->config->dungeon_font_size, 'values' => array('10px' => '10 px', '11px' => '11 px', '12px' => '12 px', '13px' => '13 px', '14px' => '14 px', '15px' => '15 px', '16px' => '16 px'), 'type' => 'select', 'rules' => 'required'), 'navbar' => array('checked' => array('on' => $this->config->dungeon_navbar_display), 'values' => array('on' => 'Rendre toujours visible la barre du haut'), 'type' => 'checkbox')))->add_submit('Enregistrer')->save(); $form_socials = $this->form->add_rules(array('facebook' => array('label' => 'Facebook', 'icon' => 'fa-facebook', 'value' => $this->config->dungeon_social_facebook, 'type' => 'text', 'description' => 'Indiquez l\'url complet'), 'twitter' => array('label' => 'Twitter', 'icon' => 'fa-twitter', 'value' => $this->config->dungeon_social_twitter, 'type' => 'text', 'description' => 'Indiquez l\'url complet'), 'google' => array('label' => 'Google+', 'icon' => 'fa-google-plus', 'value' => $this->config->dungeon_social_google, 'type' => 'text', 'description' => 'Indiquez l\'url complet'), 'steam' => array('label' => 'Page Steam', 'icon' => 'fa-steam', 'value' => $this->config->dungeon_social_steam, 'type' => 'text', 'description' => 'Indiquez l\'url complet'), 'twitch' => array('label' => 'Twitch', 'icon' => 'fa-twitch', 'value' => $this->config->dungeon_social_twitch, 'type' => 'text', 'description' => 'Indiquez l\'url complet'), 'dribble' => array('label' => 'Dribbble', 'icon' => 'fa-dribbble', 'value' => $this->config->dungeon_social_dribble, 'type' => 'text', 'description' => 'Indiquez l\'url complet'), 'behance' => array('label' => 'Behance', 'icon' => 'fa-behance', 'value' => $this->config->dungeon_social_behance, 'type' => 'text', 'description' => 'Indiquez l\'url complet'), 'deviantart' => array('label' => 'DeviantArt', 'icon' => 'fa-deviantart', 'value' => $this->config->dungeon_social_deviantart, 'type' => 'text', 'description' => 'Indiquez l\'url complet'), 'flickr' => array('label' => 'Flickr', 'icon' => 'fa-flickr', 'value' => $this->config->dungeon_social_flickr, 'type' => 'text', 'description' => 'Indiquez l\'url complet'), 'github' => array('label' => 'Github', 'icon' => 'fa-github', 'value' => $this->config->dungeon_social_github, 'type' => 'text', 'description' => 'Indiquez l\'url complet'), 'instagram' => array('label' => 'Instagram', 'icon' => 'fa-instagram', 'value' => $this->config->dungeon_social_instagram, 'type' => 'text', 'description' => 'Indiquez l\'url complet'), 'youtube' => array('label' => 'Youtube', 'icon' => 'fa-youtube', 'value' => $this->config->dungeon_social_youtube, 'type' => 'text', 'description' => 'Indiquez l\'url complet')))->add_submit('Enregistrer')->save(); if ($form_header->is_valid($post)) { if ($post['header']) { $this->config('dungeon_header', $post['header'], 'int'); } else { $this->db->where('name', 'dungeon_header')->delete('nf_settings'); } if ($post['logo']) { $this->config('dungeon_logo', $post['logo'], 'int'); } else { $this->db->where('name', 'dungeon_logo')->delete('nf_settings'); } $this->config('dungeon_header_repeat', $post['repeat'])->config('dungeon_header_attachment', in_array('on', $post['fixed']) ? 'fixed' : 'scroll')->config('dungeon_header_position', $post['positionX'] . ' ' . $post['positionY'])->config('dungeon_header_color', $post['color'])->config('dungeon_logo', $post['logo'], 'int'); refresh(); } else { if ($form_background->is_valid($post)) { if ($post['background']) { $this->config('dungeon_background', $post['background'], 'int'); } else { $this->db->where('name', 'dungeon_background')->delete('nf_settings'); } $this->config('dungeon_background_repeat', $post['repeat'])->config('dungeon_background_attachment', in_array('on', $post['fixed']) ? 'fixed' : 'scroll')->config('dungeon_background_position', $post['positionX'] . ' ' . $post['positionY'])->config('dungeon_background_color', $post['color']); refresh(); } else { if ($form_settings->is_valid($post)) { $this->config('dungeon_theme_color', $post['theme_color'])->config('dungeon_font_color', $post['font_color'])->config('dungeon_font_size', $post['font_size'])->config('dungeon_display', $post['display'])->config('dungeon_navbar_display', in_array('on', $post['navbar']), 'bool'); refresh(); } else { if ($form_socials->is_valid($post)) { $this->config('dungeon_social_facebook', $post['facebook'])->config('dungeon_social_twitter', $post['twitter'])->config('dungeon_social_google', $post['google'])->config('dungeon_social_steam', $post['steam'])->config('dungeon_social_twitch', $post['twitch'])->config('dungeon_social_dribble', $post['dribble'])->config('dungeon_social_behance', $post['behance'])->config('dungeon_social_deviantart', $post['deviantart'])->config('dungeon_social_flickr', $post['flickr'])->config('dungeon_social_github', $post['github'])->config('dungeon_social_instagram', $post['instagram'])->config('dungeon_social_youtube', $post['youtube']); refresh(); } } } } return new Row(new Col(new Panel(array('content' => $this->load->view('admin/menu', array('theme_name' => $theme->get_name())), 'body' => FALSE)), 'col-md-3'), new Col(new Panel(array('title' => 'Dashboard', 'icon' => 'fa-dashboard', 'content' => $this->load->view('admin/index', array('theme' => $theme, 'form_header' => $form_header->display(), 'form_background' => $form_background->display(), 'form_settings' => $form_settings->display(), 'form_socials' => $form_socials->display())))), 'col-md-9')); }
public function actionUpdate($id) { $this->view->title = __('update content type') . "#" . $id; $model = Field::find($id); $model->scenario = 'all'; if ($this->populate($_POST, $model) && $model->validate()) { $model->save(); flash('success', __('update sucessful')); refresh(); } echo $this->render('form', array('model' => $model, 'name' => 'content', 'widget' => $this->widget)); }
function refresh($parent) { $result2 = dbquery("SELECT forum_id FROM " . DB_FORUMS . " WHERE forum_parent='" . $parent . "' ORDER BY forum_order"); $k = 1; $list = ""; while ($data2 = dbarray($result2)) { $result3 = dbquery("UPDATE " . DB_FORUMS . " SET forum_order='" . $k . "' WHERE forum_id='" . $data2['forum_id'] . "'"); $k++; $list .= refresh($data2['forum_id']); } return $list; }
public function actionUpdate($id) { $this->view->title = __('update user') . "#" . $id; $model = \app\modules\auth\models\User::find($id); $model->scenario = 'update'; if ($this->populate($_POST, $model) && $model->validate()) { $model->save(); flash('success', __('update password sucessful')); refresh(); } echo $this->render('form', array('model' => $model, 'name' => 'user_update')); }
public function actionUpdate($id) { $this->view->title = __('update config') . "#" . $id; $model = Config::find($id); $model->scenario = 'all'; if ($this->populate($_POST, $model) && $model->validate()) { $model->save(); flash('success', __('update config sucessful')); refresh(); } echo $this->render('form', array('model' => $model, 'name' => 'user_update')); }
public function actionUpdate($id) { $this->view->title = __('update group'); $model = \app\modules\auth\models\Group::find($id); $model->scenario = 'update'; if ($this->populate($_POST, $model) && $model->validate()) { $model->save(); flash('success', __('update group sucessful')); refresh(); } echo $this->render('form', array('model' => $model, 'name' => 'group_create')); }
/** * Post a message and get changes since last request * * @param string $msg Message to post * * @return array|false */ function addLine(string $msg) { global $filename; $file = fopen($filename, 'a'); $date = date('Y-m-d h:i:s'); $msg = strip_tags(stripslashes($msg)); $remote = $_SERVER['REMOTE_ADDR']; // generate unique-ish color for IP $color = colorifyIp($remote); fwrite($file, '<span style="color:#' . $color . '">' . $date . '</span> ' . htmlspecialchars($msg) . '<br />' . "\r\n"); fclose($file); return refresh(0); }
public function index($theme) { $this->css('admin')->js('admin')->load->library('form')->add_rules(array('background' => array('label' => $this('background'), 'value' => $this->config->{'default_background'}, 'type' => 'file', 'upload' => 'themes/default/backgrounds', 'info' => i18n('file_picture', file_upload_max_size() / 1024 / 1024), 'check' => function ($filename, $ext) { if (!in_array($ext, array('gif', 'jpeg', 'jpg', 'png'))) { return i18n('select_image_file'); } }), 'repeat' => array('label' => $this('background_repeat'), 'value' => $this->config->{'default_background_repeat'}, 'values' => array('no-repeat' => $this('no'), 'repeat-x' => $this('horizontally'), 'repeat-y' => $this('vertically'), 'repeat' => $this('both')), 'type' => 'radio', 'rules' => 'required'), 'positionX' => array('label' => $this('position'), 'value' => explode(' ', $this->config->{'default_background_position'})[0], 'values' => array('left' => $this('left'), 'center' => $this('center'), 'right' => $this('right')), 'type' => 'radio', 'rules' => 'required'), 'positionY' => array('value' => explode(' ', $this->config->{'default_background_position'})[1], 'values' => array('top' => $this('top'), 'center' => $this('middle'), 'bottom' => $this('bottom')), 'type' => 'radio', 'rules' => 'required'), 'fixed' => array('value' => $this->config->{'default_background_attachment'}, 'values' => array('on' => $this('background_fixed')), 'type' => 'checkbox'), 'color' => array('label' => $this('background_color'), 'value' => $this->config->{'default_background_color'}, 'type' => 'colorpicker', 'rules' => 'required')))->add_submit($this('save')); if ($this->form->is_valid($post)) { if ($post['background']) { $this->config('default_background', $post['background'], 'int'); } else { $this->db->where('name', 'default_background')->delete('nf_settings'); } $this->config('default_background_repeat', $post['repeat'])->config('default_background_attachment', in_array('on', $post['fixed']) ? 'fixed' : 'scroll')->config('default_background_position', $post['positionX'] . ' ' . $post['positionY'])->config('default_background_color', $post['color']); refresh(); } return new Row(new Col(new Panel(array('content' => $this->load->view('admin/menu', array('theme_name' => $theme->name)), 'body' => FALSE)), 'col-md-4 col-lg-3'), new Col(new Panel(array('title' => $this('dashboard'), 'icon' => 'fa-cog', 'content' => $this->load->view('admin/index', array('theme' => $theme, 'form_background' => $this->form->display())))), 'col-md-8 col-lg-9')); }
public function init($model, $order_field = 'pos') { $this->CI->load->model($model, 'm'); $ids = $this->CI->input->post($this->mPostName); // save to database if (!empty($ids)) { for ($i = 0; $i < count($ids); $i++) { $updated = $this->CI->m->update($ids[$i], array($order_field => $i + 1)); } // refresh page (interrupt other logic) $this->CI->system_message->set_success('Successfully updated sort order.'); refresh(); } // return all records in sorted order $this->CI->db->order_by($order_field, 'ASC'); $items = $this->CI->m->get_all(); $this->mItems = $items; return $this; }
function terminologyParser(&$parser, &$text) { global $wgRequest, $wgTemplateName, $wgTermField, $wgDefinitionField; $templatename = $wgTemplateName ? $wgTemplateName : "Lexicon"; $termfield = $wgTermField ? $wgTermField : "term"; $definitionfield = $wgDefinitionField ? $wgDefinitionField : "definition"; $action = $wgRequest->getVal('action', 'view'); if ($action == "edit" || $action == "ajax" || isset($_POST['wpPreview'])) { return false; } $cache_state = get_cache_state(); $dbr = wfGetDB(DB_SLAVE); if ($cache_state == 'reload') { full_refresh(); } $res = $dbr->select(array('Lexicon_cache'), array('id', 'term', 'def', 'url', 'dirty'), array(), __METHOD__); #array('ORDER BY' => 'LENGTH(TRIM(term))'); $changed = false; $doc = new DOMDocument(); @$doc->loadHTML('<meta http-equiv="content-type" content="charset=utf-8"/>' . $text); while ($row = $dbr->fetchObject($res)) { if ($row->id == '0') { continue; } if ($row->dirty) { if (!refresh(&$row)) { continue; } } $term = $row->term; $definition = $row->def; $url = $row->url; if (terminologyParseThisNode($doc, $doc->documentElement, $term, $definition, $url)) { $changed = true; } } if ($changed) { $text = $doc->saveHTML(); } return true; }
public function maintenance() { $this->title($this('maintenance'))->icon('fa-power-off')->css('maintenance')->js('maintenance'); $form_opening = $this->load->library('form')->add_rules(array('opening' => array('type' => 'datetime', 'value' => $this->config->nf_maintenance_opening)))->fast_mode()->add_submit($this('save'))->save(); $form_maintenance = $this->form->add_rules(array('title' => array('label' => $this('title'), 'type' => 'text', 'value' => $this->config->nf_maintenance_title), 'content' => array('label' => $this('content'), 'type' => 'editor', 'value' => $this->config->nf_maintenance_content), 'logo' => array('label' => $this('logo'), 'value' => $this->config->nf_maintenance_logo, 'type' => 'file', 'upload' => 'maintenance', 'info' => $this('file_picture', file_upload_max_size() / 1024 / 1024), 'check' => function ($filename, $ext) { if (!in_array($ext, array('gif', 'jpeg', 'jpg', 'png'))) { return i18n('select_image_file'); } }), 'background' => array('label' => $this('background'), 'value' => $this->config->nf_maintenance_background, 'type' => 'file', 'upload' => 'maintenance', 'info' => $this('file_picture', file_upload_max_size() / 1024 / 1024), 'check' => function ($filename, $ext) { if (!in_array($ext, array('gif', 'jpeg', 'jpg', 'png'))) { return i18n('select_image_file'); } }), 'repeat' => array('label' => $this('background_repeat'), 'value' => $this->config->nf_maintenance_background_repeat, 'values' => array('no-repeat' => $this('no'), 'repeat-x' => $this('horizontally'), 'repeat-y' => $this('vertically'), 'repeat' => $this('both')), 'type' => 'radio'), 'positionX' => array('label' => $this('position'), 'value' => $this->config->nf_maintenance_background_position ? explode(' ', $this->config->nf_maintenance_background_position)[0] : '', 'values' => array('left' => $this('left'), 'center' => $this('center'), 'right' => $this('right')), 'type' => 'radio'), 'positionY' => array('value' => $this->config->nf_maintenance_background_position ? explode(' ', $this->config->nf_maintenance_background_position)[1] : '', 'values' => array('top' => $this('top'), 'center' => $this('middle'), 'bottom' => $this('bottom')), 'type' => 'radio'), 'background_color' => array('label' => $this('background_color'), 'value' => $this->config->nf_maintenance_background_color, 'type' => 'colorpicker'), 'text_color' => array('label' => $this('text_color'), 'value' => $this->config->nf_maintenance_text_color, 'type' => 'colorpicker'), 'facebook' => array('label' => 'Facebook', 'icon' => 'fa-facebook', 'value' => $this->config->nf_maintenance_facebook, 'type' => 'url'), 'twitter' => array('label' => 'Twitter', 'icon' => 'fa-twitter', 'value' => $this->config->nf_maintenance_twitter, 'type' => 'url'), 'google' => array('label' => 'Google+', 'icon' => 'fa-google-plus', 'value' => $this->config->{'nf_maintenance_google-plus'}, 'type' => 'url'), 'steam' => array('label' => 'Steam', 'icon' => 'fa-steam', 'value' => $this->config->nf_maintenance_steam, 'type' => 'url'), 'twitch' => array('label' => 'Twitch', 'icon' => 'fa-twitch', 'value' => $this->config->nf_maintenance_twitch, 'type' => 'url')))->add_submit($this('save'))->save(); if ($form_opening->is_valid($post)) { $this->config('nf_maintenance_opening', $post['opening']); refresh(); } else { if ($form_maintenance->is_valid($post)) { $this->config('nf_maintenance_title', $post['title'])->config('nf_maintenance_content', $post['content'])->config('nf_maintenance_logo', $post['logo'], 'int')->config('nf_maintenance_background', $post['background'], 'int')->config('nf_maintenance_background_repeat', $post['repeat'])->config('nf_maintenance_background_position', $post['positionX'] . ' ' . $post['positionY'])->config('nf_maintenance_background_color', $post['background_color'])->config('nf_maintenance_text_color', $post['text_color'])->config('nf_maintenance_facebook', $post['facebook'])->config('nf_maintenance_twitter', $post['twitter'])->config('nf_maintenance_google-plus', $post['google'])->config('nf_maintenance_steam', $post['steam'])->config('nf_maintenance_twitch', $post['twitch']); refresh(); } } return new Row(new Col(new Panel(array('title' => $this('website_status'), 'icon' => 'fa-power-off', 'content' => $this->load->view('maintenance'))), new Panel(array('title' => $this('planned_opening'), 'icon' => 'fa-clock-o', 'content' => $form_opening->display())), 'col-md-3'), new Col(new Panel(array('title' => $this('customizing_maintenance_page'), 'icon' => 'fa-paint-brush', 'content' => $form_maintenance->display())), 'col-md-9')); }
$s = $faqClass->add($itemID); if ($s === true) { refresh('/' . $languageURL . 'items/faq/' . $itemID . '/', $langArray['complete_add_faq'], 'complete'); } else { $message = '<ul>'; foreach ($s as $e) { $message .= '<li>' . $e . '</li>'; } $message .= '</ul>'; addErrorMessage($message, '', 'error'); } } $faqClass = new faq(); if (check_login_bool() && $item['user_id'] == $_SESSION['user']['user_id'] && isset($_GET['del']) && is_numeric($_GET['del'])) { $faqClass->delete($_GET['del'], $itemID); refresh('/' . $languageURL . 'items/faq/' . $itemID . '/', $langArray['complete_delete_faq'], 'complete'); } #加载FAQ $faq = $faqClass->getAll($itemID); abr('faq', $faq); #标签标记作品 require_once ROOT_PATH . '/apps/items/controllers/bookmark.php'; #是否免费文件 if ($item['free_file'] == 'true') { abr('freeFileMessage', langMessageReplace($langArray['free_file_info'], array('URL' => '/' . $languageURL . 'users/downloads/' . $item['id']))); } #加载其它作品 $otherItems = $itemsClass->getAll(0, 6, " `status` = 'active' AND `id` <> '" . intval($itemID) . "' AND `user_id` = '" . intval($item['user_id']) . "' ", "RAND()"); abr('otherItems', $otherItems); if (!is_array($otherItems)) { abr('otherItemsCount', 0);
<?php // +---------------------------------------------------------------------- // | Demila [ Beautiful Digital Content Trading System ] // +---------------------------------------------------------------------- // | Copyright (c) 2015 http://demila.org All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- // | Email author@demila.org // +---------------------------------------------------------------------- _setView(ROOT_PATH . '/apps/users/controllers/login.php'); unset($_SESSION['user']); refresh('/' . $languageURL);
function moveList($subject, $path) { global $pathURL, $pathHTML, $subjectURL, $subjectHTML, $nonce; if (isset($_GET['to']) && !isNull($_GET['to'])) { $to = $_GET['to']; $toHTML = htmlspecialchars($to); $toURL = escape($to); } if (isNull($subject, $path, $to)) { return refresh('Values could not be read'); } $return = '["div", {attributes: {"id": "movelist"}}, [ "span", {attributes: {"class": "pathCrumbs"}}, [ '; $crumbs = explode('/', $toHTML); $crumbsLink = explode('/', $toURL); $pathSplit = ''; for ($i = 0; $i < count($crumbs); $i++) { $slash = $i ? '/' : null; $pathSplit .= $slash . $crumbsLink[$i]; $return .= ($i ? ',' : null) . '"a", { attributes : { "href" : "#", "title" : "Go to ' . $crumbs[$i] . '" }, events : { click : function(e){ fOp.moveList("' . $subjectURL . '", "' . $pathURL . '", "' . $pathSplit . '"); e.preventDefault ? e.preventDefault() : e.returnValue = false; } }, text : "' . ($i ? $crumbs[$i] : 'root') . '", postText : " / " }'; } $return .= ' ], "ul", {attributes: {"id": "moveListUL"}}'; $j = 0; //TODO: sort output $handle = opendir($to); while (($dirItem = readdir($handle)) !== false) { $fullPath = $to . '/' . $dirItem; if (!is_dir($fullPath) || $dirItem == '.' || $dirItem == '..') { continue; } $fullPathURL = escape($fullPath); $dirItemHTML = htmlspecialchars($dirItem); $return .= ', [ "li", {}, [ "a", { attributes : {"href" : "#"}, events : { click : function(e){ fOp.moveList("' . $subjectURL . '", "' . $pathURL . '", "' . $fullPathURL . '"); e.preventDefault ? e.preventDefault() : e.returnValue = false; } } }, ["img", {attributes: {"src": "' . $_R['images/odir.png'] . '", "title": "Open ' . $dirItemHTML . '"}}], "a", { attributes: {"href": "?do=move&subject=' . $subjectURL . '&path=' . $pathURL . '&to=' . $fullPathURL . '&nonce=' . $nonce . '", "title" : "move ' . $subject . ' to ' . $dirItemHTML . '", "class": "dir"}, text: "' . $dirItemHTML . '" } ] ]'; $j++; } if (!$j) { $return .= ', "b", {text: "No directories found"}, "br", {}, "br", {}'; } $return .= ', "a", { attributes: {"href": "?do=move&subject=' . $subjectURL . '&path=' . $pathURL . '&to=' . $toURL . '&nonce=' . $nonce . '", "id": "movehere", "title": "move here (' . $toHTML . ')"}, text : "move here" }] ]'; return $return; }
} } } elseif ($_POST['licence'] == 'extended') { if (isset($_POST['pay_method']) && $_POST['pay_method'] == 'paymethod') { $orderID = $ordersClass->add($item['extended_price'], 'true'); if (isset($_SESSION['tmp']['deposit_id'])) { unset($_SESSION['tmp']['deposit_id']); } $_SESSION['tmp']['order_id'] = $orderID; refresh('/' . $languageURL . 'items/payment/'); } else { if ($_SESSION['user']['total'] < $item['extended_price']) { addErrorMessage($langArray['error_not_enought_money'], '', 'error'); } else { $ordersClass->buy($item['extended_price'], true); refresh('/' . $languageURL . 'download/', $langArray['complete_buy_theme'], 'complete'); } } } } #标签标记作品 require_once ROOT_PATH . '/apps/items/controllers/bookmark.php'; #是否免费文件 if ($item['free_file'] == 'true') { abr('freeFileMessage', langMessageReplace($langArray['free_file_info'], array('URL' => '/' . $languageURL . 'users/downloads/' . $item['id']))); } #加载其它作品 $otherItems = $itemsClass->getAll(0, 6, " `status` = 'active' AND `id` <> '" . intval($itemID) . "' AND `user_id` = '" . intval($item['user_id']) . "' ", "RAND()"); abr('otherItems', $otherItems); if (!is_array($otherItems)) { abr('otherItemsCount', 0);
public function admin_user_reset_password($user_id) { // only top-level users can reset Admin User passwords $this->verify_auth(array('webmaster')); $form = $this->form_builder->create_form(); if ($form->validate()) { // pass validation $data = array('password' => $this->input->post('new_password')); if ($this->ion_auth->update($user_id, $data)) { $messages = $this->ion_auth->messages(); $this->system_message->set_success($messages); } else { $errors = $this->ion_auth->errors(); $this->system_message->set_error($errors); } refresh(); } $this->load->model('admin_user_model', 'admin_users'); $target = $this->admin_users->get($user_id); $this->mViewData['target'] = $target; $this->mViewData['form'] = $form; $this->mTitle .= 'Reset Admin User Password'; $this->render('panel/admin_user_reset_password'); }
// +---------------------------------------------------------------------- // | Demila [ Beautiful Digital Content Trading System ] // +---------------------------------------------------------------------- // | Copyright (c) 2015 http://demila.org All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- // | Email author@demila.org // +---------------------------------------------------------------------- _setView(__FILE__); _setTitle($langArray['add']); $cms = new categories(); if (!isset($_GET['sub_of']) || !is_numeric($_GET['sub_of'])) { $_GET['sub_of'] = 0; } if (isset($_POST['add'])) { $status = $cms->add(); if ($status !== true) { abr('error', $status); } else { refresh("?m=" . $_GET['m'] . "&c=list&sub_of=" . $_GET['sub_of'], $langArray['add_complete']); } } else { $_POST['visible'] = 'true'; } if ($_GET['sub_of'] != 0) { $pdata = $cms->get($_GET['sub_of']); abr('pdata', $pdata); } require_once ROOT_PATH . '/apps/lists/leftlist_admin.php';
$_SESSION['history'] = substr($_SESSION['history'], 0, -1); $hist_arr = explode("\n", $_SESSION['history']); } $first_word = first_word($_POST['cmd']); if (array_key_exists($first_word, $alias)) { //. CHECKING FOR ALIASES $_POST['cmd'] = $alias[$first_word] . substr($_POST['cmd'], strlen($first_word)); $first_word = first_word($_POST['cmd']); } switch ($first_word) { case "clear": $_SESSION['output'] = ""; break; case "exit": session_destroy(); refresh(); break; case "cd": $_SESSION['output'] .= $prompt; $result = shell_exec($_POST['cmd'] . " 2>&1 ; pwd"); $result = explode("\n", $result); $_SESSION['dir'] = $result[count($result) - 2]; if (count($result) > 2) { //.............. WE HAVE AN ERROR MESSAGE $result[0] = "\n" . substr($result[0], strpos($result[0], "cd: ")) . "\n"; } else { $result[0] = "\n"; } $prompt = set_prompt(); $_SESSION['output'] .= $_POST['cmd'] . $result[0]; break;
#加载类别 $categoriesClass = new ccategories(); $categories = $categoriesClass->getAll(0, 0, " `visible` = 'true'"); abr('categories', $categories); #发送联系支持请求 if (isset($_POST['action'])) { //验证码验证 if (isset($_POST['verify'])) { if (empty($_POST['verify'])) { addErrorMessage($langArray['error_verify_invalid_empty'], '', 'error'); } require_once ROOT_PATH . '/classes/Verify.class.php'; $verify = new Verify(); $yz_verify = $verify->check($_POST['verify'], 1); if (!$yz_verify) { addErrorMessage($langArray['error_invalid_verify'], '', 'error'); } else { $contactsClass = new contacts(); $s = $contactsClass->add(); if ($s === true) { refresh('/' . $languageURL . 'support/', $langArray['complete_send_email'], 'complete'); } else { addErrorMessage($langArray['error_all_fields_required'], '', 'error'); } } } else { addErrorMessage($langArray['error_verify_invalid_empty'], '', 'error'); } } #面包屑 abr('breadcrumb', '<a href="/' . $languageURL . '" title="">' . $langArray['home'] . '</a> \\ <a href="/' . $languageURL . 'contacts/" title="">' . $langArray['contacts'] . '</a>');
<?php // +---------------------------------------------------------------------- // | Demila [ Beautiful Digital Content Trading System ] // +---------------------------------------------------------------------- // | Copyright (c) 2015 http://demila.org All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- // | Email author@demila.org // +---------------------------------------------------------------------- if (!isset($_GET['type']) || !in_array($_GET['type'], array('other', 'buyers', 'authors', 'referrals', 'system'))) { refresh('?m=' . $_GET['m'] . '&c=badges&type=system', '', 'error'); } _setView(__FILE__); _setTitle($langArray['badges'] . ' › ' . ucfirst($_GET['type'])); $types = array('system', 'other', 'buyers', 'authors', 'referrals'); $tmp = array(); foreach ($types as $type) { $tmp[] = array('name' => ucfirst($type), 'href' => '?m=' . $_GET['m'] . '&c=badges&type=' . $type); } abr('types', $tmp); require_once ROOT_PATH . '/apps/system/models/badges.class.php'; $badges = new badges(); $data = $badges->getAll(START, LIMIT, "`type`='" . $_GET['type'] . "'"); abr('data', $data); $p = paging("?m=" . $_GET['m'] . "&c=badges&type=" . $_GET['type'] . "&p=", "", PAGE, LIMIT, $badges->foundRows); abr('paging', $p); require_once ROOT_PATH . '/apps/lists/leftlist_admin.php';
<p><strong>zdarzenia:</strong></p> <p> <?php $eventy = all("select *, t.nazwa as tech_nazwa, j.nazwa as jedn_nazwa, b.nazwa as bud_nazwa, koniec - " . mktime() . " as czas from tribal_eventy left join tribal_budynki b on podtyp = b.budynek left join tribal_jednostki j on podtyp = j.jednostka left join tribal_technologie t on podtyp = t.technologia where miasto_id = " . $gracz['id_miasta'] . " and typ < 4 order by czas asc"); if (is_array($eventy)) { refresh($eventy[0]['czas']); foreach ($eventy as $event) { $czas = $event['czas']; if ($event['typ'] == 1) { echo "\n\t\t\t\t\t<div style='margin-bottom:10px'>" . $event['bud_nazwa'] . " <span style='float:right'><span id='t" . $event['event'] . "'></span> [ <a href='?akcja=budynek&id=" . $event['podtyp'] . "&przerwij'>x</a> ]</span>\n\t\t\t\t\t<script type='text/javascript'>liczCzas('t" . $event['event'] . "',{$czas});</script>\n\t\t\t\t\t</div>\n\t\t\t\t\t"; } elseif ($event['typ'] == 2) { echo "\n\t\t\t\t\t<div style='margin-bottom:10px'>" . $event['tech_nazwa'] . " <span style='float:right'><span id='t" . $event['event'] . "'>{$pozostalo}</span> [ <a href='?akcja=nauka&przerwij=" . $event['podtyp'] . "'>x</a> ]</span>\n\t\t\t\t\t<script type='text/javascript'>liczCzas('t" . $event['event'] . "',{$czas});</script>\n\t\t\t\t\t</div>\n\t\t\t\t\t"; } else { echo "\n\t\t\t\t\t<div style='margin-bottom:10px'>" . $event['jedn_nazwa'] . " <span style='float:right'><span id='t" . $event['event'] . "'>{$pozostalo}</span> [ <a href='?akcja=armia&przerwij=" . $event['event'] . "'>x</a> ]</span>\n\t\t\t\t\t<script type='text/javascript'>liczCzas('t" . $event['event'] . "',{$czas});</script>\n\t\t\t\t\t</div>\n\t\t\t\t\t"; } } } else { echo "brak zdarzeń"; } ?> </p>
// +---------------------------------------------------------------------- // | Demila [ Beautiful Digital Content Trading System ] // +---------------------------------------------------------------------- // | Copyright (c) 2015 http://demila.org All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- // | Email author@demila.org // +---------------------------------------------------------------------- _setView(__FILE__); _setTitle($langArray['payments'] . ' › ' . ucfirst($_GET['c'])); $payments = scandir(dirname(dirname(__FILE__)) . '/controllers/'); if (!in_array($_GET['c'] . '.php', $payments)) { refresh("/" . $languageURL . adminURL . "/?m=" . $_GET['m'] . "&c=list"); } $key = $_GET['c']; $form = isset($_POST['form']) ? $_POST['form'] : array(); if (isset($_POST['edit'])) { $cms = new system(); $cms->editGroup($key, $form); refresh("?m=" . $_GET['m'] . "&c=list", $langArray['edit_complete']); } abr('pay_info', $meta); abr('group', $key); //DEMILAappkey if (isset($form[$key . '_key'])) { abr('v_key', $form[$key . '_key']); } else { abr('v_key', isset($meta[$key . '_key']) ? $meta[$key . '_key'] : ''); } require_once ROOT_PATH . '/apps/lists/leftlist_admin.php';
// +---------------------------------------------------------------------- // | Demila [ Beautiful Digital Content Trading System ] // +---------------------------------------------------------------------- // | Copyright (c) 2015 http://demila.org All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- // | Email author@demila.org // +---------------------------------------------------------------------- _setView(__FILE__); $collectionID = get_id(2); $collectionsClass = new collections(); $collection = $collectionsClass->get($collectionID); if (!is_array($collection) || $collection['public'] == 'false' && check_login_bool() && $collection['user_id'] != $_SESSION['user']['user_id']) { refresh('/' . $languageURL . 'collections/', $langArray['wrong_collection'], 'error'); } if (isset($_POST['rating'])) { $_GET['rating'] = $_POST['rating']; } if (!isset($_GET['rating']) || !is_numeric($_GET['rating']) || $_GET['rating'] > 5) { $_GET['rating'] = 5; } elseif ($_GET['rating'] < 1) { $_GET['rating'] = 1; } $collection = $collectionsClass->rate($collectionID, $_GET['rating']); $stars = ''; for ($i = 1; $i < 6; $i++) { if ($collection['rating'] >= $i) { $stars .= '<img src="{$template_data}img/star-on.png" alt="" class="left" />'; } else {
/** * Reset password */ public function reset_password($user_id) { // only admin can reset user passwords $this->verify_auth('admin', 'admin/login'); $form = $this->form_builder->create_form(); if ($form->validate()) { // pass validation $data = array('password' => $this->input->post('new_password')); if ($this->ion_auth->update($user_id, $data)) { $messages = $this->ion_auth->messages(); $this->system_message->set_success($messages); } else { $errors = $this->ion_auth->errors(); $this->system_message->set_error($errors); } refresh(); } $this->load->model('user_model', 'users'); $target = $this->users->get($user_id); $this->mViewData['target'] = $target; $this->mViewData['form'] = $form; $this->render('user/reset_password'); }
<?php // +---------------------------------------------------------------------- // | Demila [ Beautiful Digital Content Trading System ] // +---------------------------------------------------------------------- // | Copyright (c) 2015 http://demila.org All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- // | Email author@demila.org // +---------------------------------------------------------------------- refresh("/" . $languageURL . adminURL . "/?m=" . $_GET['m'] . "&c=list");