function __construct($interface, $files_directory) { $field = filter_input(INPUT_POST, 'field', FILTER_SANITIZE_STRING, FILTER_FLAG_NO_ENCODE_QUOTES); // Check for file upload. if ($field === NULL || empty($_FILES) || !isset($_FILES['file'])) { return; } $this->interface = $interface; // Create a new result object. $this->result = new stdClass(); // Set directory. $this->files_directory = $files_directory; // Create the temporary directory if it doesn't exist. $dirs = array('', '/files', '/images', '/videos', '/audios'); foreach ($dirs as $dir) { if (!H5PCore::dirReady($this->files_directory . $dir)) { $this->result->error = $this->interface->t('Unable to create directory.'); return; } } // Get the field. $this->field = json_decode($field); if (function_exists('finfo_file')) { $finfo = finfo_open(FILEINFO_MIME_TYPE); $this->type = finfo_file($finfo, $_FILES['file']['tmp_name']); finfo_close($finfo); } elseif (function_exists('mime_content_type')) { // Deprecated, only when finfo isn't available. $this->type = mime_content_type($_FILES['file']['tmp_name']); } else { $this->type = $_FILES['file']['type']; } $this->extension = pathinfo($_FILES['file']['name'], PATHINFO_EXTENSION); $this->size = $_FILES['file']['size']; }
public function searchSend() { $weather = new \Models\Weather(); if (isset($_POST["day"]) && isset($_POST["month"]) && isset($_POST["year"]) && isset($_POST["type"])) { $day = htmlspecialchars(filter_input(INPUT_POST, 'day', FILTER_SANITIZE_NUMBER_INT)); $month = htmlspecialchars(filter_input(INPUT_POST, 'month', FILTER_SANITIZE_NUMBER_INT)); $year = htmlspecialchars(filter_input(INPUT_POST, 'year', FILTER_SANITIZE_NUMBER_INT)); $type = htmlspecialchars(filter_input(INPUT_POST, 'type', FILTER_SANITIZE_STRING)); $date = $year . "-" . $month . "-" . $day; $data["response"] = $weather->getAllByTypeAndDate($type, $date); echo json_encode($data["response"]); } else { if (isset($_POST["month"]) && isset($_POST["year"]) && isset($_POST["type"])) { $month = htmlspecialchars(filter_input(INPUT_POST, 'month', FILTER_SANITIZE_NUMBER_INT)); $year = htmlspecialchars(filter_input(INPUT_POST, 'year', FILTER_SANITIZE_NUMBER_INT)); $type = htmlspecialchars(filter_input(INPUT_POST, 'type', FILTER_SANITIZE_STRING)); $data["response"] = $weather->getAllByTypeAndMonth($type, $month, $year, "text"); echo json_encode($data["response"]); } else { if (isset($_POST["year"]) && isset($_POST["type"])) { $year = htmlspecialchars(filter_input(INPUT_POST, 'year', FILTER_SANITIZE_NUMBER_INT)); $type = htmlspecialchars(filter_input(INPUT_POST, 'type', FILTER_SANITIZE_STRING)); $data["response"] = $weather->getAllByTypeAndYear($type, $year, "text"); echo json_encode($data["response"]); } } } }
function verifValue($bdd, $image, $montant, $idnote) { $resultatRetour = false; //Verifie qu'un fichier est bien présent if (!isset($image) || !$image['error'] == 0) { echo 'Erreur avec le justificatif (image)'; } else { if (!strtotime(nl2br(filter_input(INPUT_POST, 'date')))) { echo 'Erreur lors de la saisie de la Date '; } else { if (strlen(filter_input(INPUT_POST, 'description')) > 255) { echo 'Description trop longue (255 caractères maximum !).'; } else { if (!is_numeric($montant) || $montant > 50000 || $montant < 0) { echo 'Montant incorrect, merci de mettre des . pour les centimes ex : 22.90'; } else { if (is_numeric($idnote)) { $check = $bdd->prepare('SELECT * FROM note_frais WHERE statut_id = 1 AND id=:id limit 1'); $check->execute(array(":id" => $idnote)); if ($check->rowCount() != 1) { echo 'Stop F12 !'; } else { $resultatRetour = true; } } else { $resultatRetour = true; } } } } } return $resultatRetour; }
protected function private_core() { $this->almacen = new almacen(); $this->clientes = new cliente(); $this->rutas_all = new distribucion_rutas(); $this->distribucion_clientes = new distribucion_clientes(); //Mandamos los botones y tabs $this->shared_extensions(); //Verificamos los accesos del usuario $this->allow_delete = $this->user->admin ? TRUE : $this->user->allow_delete_on(__CLASS__); $fecha_pedido = filter_input(INPUT_POST, 'fecha_pedido'); $fecha_facturacion = filter_input(INPUT_POST, 'fecha_facturacion'); $ruta = filter_input(INPUT_POST, 'ruta'); $codalmacen = filter_input(INPUT_POST, 'codalmacen'); $codcliente = filter_input(INPUT_POST, 'codcliente'); $this->fecha_pedido = $fecha_pedido ? $fecha_pedido : \date('d-m-Y'); $this->fecha_facturacion = $fecha_facturacion ? $fecha_facturacion : \date('d-m-Y', strtotime('+1 day')); $this->ruta = $ruta ? $ruta : false; $this->codalmacen = $codalmacen ? $codalmacen : false; $this->codcliente = $codcliente ? $codcliente : false; if ($this->codcliente) { $this->cliente = $this->clientes->get($this->codcliente); $this->cliente_nombre = $this->cliente->nombre; } $cliente = filter_input(INPUT_GET, 'buscar_cliente'); if ($cliente) { $this->buscar_cliente($cliente); } $this->rutas = $this->codalmacen ? $this->rutas_all->all_rutasporalmacen($this->empresa->id, $this->codalmacen) : array(); if ($this->ruta and $this->codalmacen) { $this->clientes_ruta = $this->distribucion_clientes->clientes_ruta($this->empresa->id, $this->codalmacen, $this->ruta); } }
public function returnGoodsStatus($i10dabd0ff3063e4a86ec016d1e108ad0fbecba80) { $i30127f0cd4894803854852241754c6b654188778 = filter_input(INPUT_POST, "notifySms"); if ($i30127f0cd4894803854852241754c6b654188778 || !isset($i30127f0cd4894803854852241754c6b654188778)) { $this->hooks->returnGoodsStatus(filter_input(INPUT_POST, "return_status_id"), filter_input(INPUT_POST, "comment"), $i10dabd0ff3063e4a86ec016d1e108ad0fbecba80); } }
public function __construct() { $url = filter_input(INPUT_GET, 'url', FILTER_SANITIZE_SPECIAL_CHARS); $url = rtrim($url, '/'); $url = explode('/', $url); $file = ROOT . '/controller/' . $url[0] . '.class.php'; define('METHOD', $url[1]); if (file_exists($file)) { require $file; } else { if (empty($url[0])) { header("Location: /article/all"); exit; } else { require ROOT . '/controller/error.class.php'; $controller = new Error(); return false; } } $controller = new $url[0](); if (isset($url[2])) { $controller->{$url}[1]($url[2]); } else { if (isset($url[1])) { $controller->{$url}[1](); } else { $controller->defaultClass(); } } }
public function post_restore() { if (isset($_POST['job_id']) && isset($_POST['backup_uniqid']) && isset($_POST['_wpnonce']) && isset($_POST['method'])) { $nonce = filter_input(INPUT_POST, '_wpnonce', FILTER_SANITIZE_STRING); if (!wp_verify_nonce($nonce, 'my-wp-backup-restore-backup')) { wp_die(esc_html__('Nope! Security check failed!', 'my-wp-backup')); } $id = absint($_POST['job_id']); $uniqid = sanitize_key($_POST['backup_uniqid']); $method = filter_input(INPUT_POST, 'method', FILTER_SANITIZE_STRING); $backup = self::get($id, $uniqid); if (!isset($backup['duration'])) { add_settings_error('', '', __('Invalid backup id/uniqid.', 'my-wp-backup')); set_transient('settings_errors', get_settings_errors()); wp_safe_redirect($this->admin->get_page_url('backup', array('settings-updated' => 1))); } if (!$backup->has_archives()) { // No local copy and no remote copy === DEAD END. if (empty($backup['destinations'])) { add_settings_error('', '', __('Backup files missing.', 'my-wp-backup')); set_transient('settings_errors', get_settings_errors()); wp_safe_redirect($this->admin->get_page_url('backup', array('settings-updated' => 1))); } if (!isset($backup['destinations'][$method])) { add_settings_error('', '', sprintf(__('No backup files from %s.', 'my-wp-backup'), Job::$destinations[$method])); set_transient('settings_errors', get_settings_errors()); wp_safe_redirect($this->admin->get_page_url('backup', array('settings-updated' => 1))); } } wp_schedule_single_event(time(), 'wp_backup_restore_backup', array(array($id, $uniqid, $method))); wp_safe_redirect($this->admin->get_page_url('backup', array('uniqid' => $uniqid, 'action' => 'viewprogress', 'id' => $id))); } }
/** * Фильтрует переменную, переданную методами post или get * @param string $name имя переменной (ключ в массиве post или get) * @param string $method константа метода, которым передана переменная (например 'INPUT_POST') * @param string $type тип переменной * @return mixed отфильтрованная переменная */ static function validateInputVar($name, $method, $type = '') { switch ($type) { case 'int': $filter = FILTER_SANITIZE_NUMBER_INT; break; case 'str': $filter = FILTER_SANITIZE_STRING; break; case 'url': $filter = FILTER_SANITIZE_URL; break; case 'email': $filter = FILTER_SANITIZE_EMAIL; break; case 'html': $filter = 'html'; break; default: $filter = FILTER_DEFAULT; } if (!defined($method)) { if (!preg_match('/^input/i', $method)) { $method = 'INPUT_' . strtoupper($method); } } $method = constant($method); if (filter_has_var($method, $name)) { if ($filter === 'html') { return strip_tags(filter_input($method, $name), '<a><p><b><strong><table><th><tr><td><area><article><big><br><center><dd><div><dl><dt><dir><em><embed><figure><font><hr><h1><h2><h3><h4><h5><h6><img><ol><ul><li><small><sup><sub><tt><time><tfoot><thead><tbody><u>'); } else { return filter_input($method, $name, $filter); } } }
private function saveProcess() { if ($_SERVER['REQUEST_METHOD'] != 'POST') { View::setMessageFlash("danger", "Form tidak valid"); return FALSE; } // form validation if (!filter_input(INPUT_POST, "form_token") || Form::isFormTokenValid(filter_input(INPUT_POST, "form_token"))) { View::setMessageFlash("danger", "Form tidak valid"); return FALSE; } // required fields $filter = array("name" => FILTER_SANITIZE_STRING, "phone" => FILTER_SANITIZE_STRING, "address" => FILTER_SANITIZE_STRING); $input = filter_input_array(INPUT_POST, $filter); if (in_array('', $input) || in_array(NULL, $input)) { View::setMessageFlash("danger", "Kolom tidak boleh kosong"); return FALSE; } // set member object $staff = Authentication::getUser(); $staff->setData('name', $input['name']); $staff->setData('phone', $input['phone']); $staff->setData('address', $input['address']); if (!($update = $staff->update())) { View::setMessageFlash("danger", "Penyimpanan Gagal"); return; } View::setMessageFlash("success", "Penyimpanan Berhasil"); }
public function fireAction() { $row = filter_input(INPUT_POST, 'row'); $col = filter_input(INPUT_POST, 'col'); $view = new \View(); if (!$row || !$col) { $view->dislayJson(array('status' => 0, 'msg' => 'Invalid coordinates!')); return; } //fire $status = $this->fire($row, $col); $view->grid = $this->board->getGrid(); $view->symbols = $this->getBoardSymbols(); $view->rows = $this->getRowsNames(); $view->cols = $this->getColsNames(); //Get the html for the board ob_start(); $view->display('Web/board'); $html = ob_get_contents(); ob_clean(); $data = array('status' => 1, 'msg' => $this->getMessageByStatus($status), 'html' => $html, 'tries' => $this->board->getTries()); $view->dislayJson($data); //Reset the game if it's over if ($this->isGameOver()) { $this->reset(); } }
public function show() { //取得頁數資訊 //控制參數 $qlimit = array(); $modelName = $this->getModelName(); $model = new $modelName(); $searchSQL = self::getJQGridSearchParams(); //echo($searchSQL); $id = filter_input(INPUT_GET, 'row_id', FILTER_SANITIZE_NUMBER_INT); if ($id) { //$id = $this->parseDataInFormat($id, 'd_id'); $qlimit[] = 'a.m_id=' . $id; } if ($searchSQL) { $qlimit[] = $searchSQL; } $qlimit = self::implodeQueryFilters($qlimit); return $model->getJQGridGridData($qlimit, array('SQL_SELECT' => 'a.m_id, a.m_name, a.m_sat_name, a.s_property, a.m_img, a.m_place, a.m_subplace, a.m_lv, a.m_meet, a.m_mission, b.m_subject, a.m_npc, a.m_npc_message, a.hp, a.sp, a.at, a.df, a.mat, a.mdf, a.str, a.smart, a.agi, a.life, a.vit, a.au, a.be, a.skill_1, a.skill_2, a.skill_3, a.skill_4, a.skill_5, a.time_1, a.time_2, a.time_3, a.m_job_Exp, a.d_id, a.m_topr ', 'SQL_FROM' => 'wog_monster a LEFT JOIN wog_mission_main b ON b.m_id=a.m_mission', 'sanitize' => array('MonsterController', 'sanitizeShowData'))); }
/** * Check if this is the current section. * @return boolean True if this is the currently active section. */ public function is_current_section() { if (!isset($this->active)) { $this->active = filter_input(INPUT_GET, 'section') == $this->get_slug(); } return $this->active; }
function __construct() { $this->getCluster = filter_input(INPUT_POST, "getParam"); $this->userid = filter_input(INPUT_POST, "userid"); $this->part = 'modelfile/' . $this->userid . '/'; $this->getContent(); }
public function __construct() { if (isset($_GET['url'])) { //se verifica que la variable url no este vacia, en caso de que no entra en la condicion y la filtra $url = filter_input(INPUT_GET, 'url', FILTER_SANITIZE_URL); //se le envia la manera como va a llegar sea por post o get, despues la variable, y con el sanitize se limpia de caracteres especiales $url = explode('/', $url); //se recorre la url, y cada vez que encuentre un slas la separa y crea un array $url = array_filter($url); //recorre el array y lo limpia de los caracteres especiales $this->_controlador = strtolower(array_shift($url)); //coje la primera posicion del array, la convierte en minuscula con strlower y la asigna a la variable _controlador $this->_metodo = strtolower(array_shift($url)); //coje la primera posicion del array, la convierte en minuscula con strlower y la asigna a la variable _metodo $this->_parametros = $url; //coje lo que queda en el array y lo mete en la variable _parametros } if (!$this->_controlador) { $this->_controlador = DEFAULT_CONTROLLER; } //en caso de que la url venga vacia asigna el controlador index por defecto el que se creo en el config if (!$this->_metodo) { $this->_metodo = 'index'; //en caso de que el metodo venga vacio asigna el metod index por defecto } if (!isset($this->_parametros)) { $this->_parametros = array(); //si los parametros no existen le dira a la variable que va a ser de tipo array } }
private function setRoute() { $this->route = filter_input(INPUT_GET, 'request', FILTER_SANITIZE_URL); $this->route = trim($this->route, "/"); $this->route = explode("/", $this->route); $this->checkForEmptyRoute(); }
public function private_core() { $this->allow_delete = $this->user->allow_delete_on(__CLASS__); $this->almacen = new almacen(); $this->agencia_transporte = new agencia_transporte(); $this->distribucion_tipounidad = new distribucion_tipounidad(); $this->distribucion_unidades = new distribucion_unidades(); $delete = \filter_input(INPUT_GET, 'delete'); $codalmacen = \filter_input(INPUT_POST, 'codalmacen'); $codtrans = \filter_input(INPUT_POST, 'codtrans'); $placa_val = \filter_input(INPUT_POST, 'placa'); $capacidad = \filter_input(INPUT_POST, 'capacidad'); $tipounidad = \filter_input(INPUT_POST, 'tipounidad'); $estado_val = \filter_input(INPUT_POST, 'estado'); $estado = isset($estado_val) ? true : false; $placa = !empty($delete) ? $delete : $placa_val; $unidad = new distribucion_unidades(); $unidad->idempresa = $this->empresa->id; $unidad->placa = trim(strtoupper($placa)); $unidad->codalmacen = $codalmacen; $unidad->codtrans = (string) $codtrans; $unidad->tipounidad = (int) $tipounidad; $unidad->capacidad = (int) $capacidad; $unidad->estado = $estado; $unidad->usuario_creacion = $this->user->nick; $unidad->fecha_creacion = \Date('d-m-Y H:i:s'); $condicion = !empty($delete) ? 'delete' : 'update'; $valor = !empty($delete) ? $delete : $placa; if ($valor) { $this->tratar_unidad($valor, $condicion, $unidad); } $this->listado = $this->distribucion_unidades->all($this->empresa->id); }
protected function get_id_view() { $prep = $this->connection->prepare(' SELECT d.dept_name, v.margin, d.dept_no AS deptID FROM departments AS d LEFT JOIN VendorSpecificMargins AS v ON v.deptID=d.dept_no AND v.vendorID=? ORDER BY d.dept_no '); $res = $this->connection->execute($prep, array($this->id)); $ret = '<form method="post" action="' . filter_input(INPUT_SERVER, 'PHP_SELF') . '">'; $ret .= '<table class="table table-bordered table-striped"> <tr><th>Dept#</th><th>Name</th><th>Margin</th></tr>'; while ($row = $this->connection->fetchRow($res)) { $ret .= sprintf('<tr> <td>%d<input type="hidden" name="id[]" value="%d" /></td> <td>%s</td> <td> <div class="input-group"> <input type="text" class="form-control" name="margin[]" value="%.2f" /> <span class="input-group-addon">%%</span> </div> </td> </tr>', $row['deptID'], $row['deptID'], $row['dept_name'], 100 * $row['margin']); } $ret .= '</table> <input type="hidden" name="vendorID" value="' . $this->id . '" /> <p><button type="submit" class="btn btn-default btn-core">Save</button></p> </form>'; return $ret; }
/** * * * @return \simpleResponse */ function execute() { $response = new simpleResponse(); try { include './inc/incWebServiceSessionValidation.php'; $app_id = filter_input(INPUT_GET, "app_id"); $appToModify = da_apps_registry::GetApp($app_id); $appToModify->account_id = filter_input(INPUT_GET, "account_id"); $appToModify->app_nickname = filter_input(INPUT_GET, "app_nickname"); $appToModify->app_description = filter_input(INPUT_GET, "app_description"); $appToModify->visibility_type_id = filter_input(INPUT_GET, "visibility_type_id"); if ($appToModify->account_id > 0 && $appToModify->app_nickname != "" && $appToModify->app_description != "" && $appToModify->visibility_type_id > 0) { $modifiedApp = da_apps_registry::UpdateApp($appToModify); $response->status = "OK"; $response->message = "SUCCESS"; $response->data = $modifiedApp; } else { $response->status = "ERROR"; if (!$appToModify->account_id > 0) { $response->message = "Parámetros Inválidos - AccountID"; } if ($appToModify->app_nickname == "") { $response->message = "Parámetros Inválidos - Nickname"; } if ($appToModify->app_description == "") { $response->message = "Parámetros Inválidos - Description"; } } } catch (Exception $ex) { $response->status = "EXCEPTION"; $response->message = $ex->getMessage(); } return $response; }
/** * Load the introduction tour */ function intro_tour() { global $pagenow, $current_user; $admin_pages = array('dashboard' => array('content' => '<h3>' . __('General settings', 'wordpress-seo') . '</h3><p>' . __('These are the General settings for WordPress SEO, here you can restart this tour or revert the WP SEO settings to default.', 'wordpress-seo') . '</p>' . '<p><strong>' . __('Tracking', 'wordpress-seo') . '</strong><br/>' . __('To provide you with the best experience possible, we need your help. Please enable tracking to help us gather anonymous usage data.', 'wordpress-seo') . '</p>' . '<p><strong>' . __('Tab: Your Info / Company Info', 'wordpress-seo') . '</strong><br/>' . __('Add some info here needed for Google\'s Knowledge Graph.', 'wordpress-seo') . '</p>' . '<p><strong>' . __('Tab: Webmaster Tools', 'wordpress-seo') . '</strong><br/>' . __('You can add the verification codes for the different Webmaster Tools programs here, we highly encourage you to check out both Google and Bing’s Webmaster Tools.', 'wordpress-seo') . '</p>' . '<p><strong>' . __('Tab: Security', 'wordpress-seo') . '</strong><br/>' . __('Determine who has access to the plugins advanced settings on the post edit screen.', 'wordpress-seo') . '</p>' . '<p><strong>' . __('More WordPress SEO', 'wordpress-seo') . '</strong><br/>' . sprintf(__('There’s more to learn about WordPress & SEO than just using this plugin. A great start is our article %1$sthe definitive guide to WordPress SEO%2$s.', 'wordpress-seo'), '<a target="_blank" href="' . esc_url('https://yoast.com/articles/wordpress-seo/#utm_source=wpseo_dashboard&utm_medium=wpseo_tour&utm_campaign=tour') . '">', '</a>') . '</p>' . '<p><strong style="font-size:150%;">' . __('Subscribe to our Newsletter', 'wordpress-seo') . '</strong><br/>' . __('If you would like us to keep you up-to-date regarding WordPress SEO and other plugins by Yoast, subscribe to our newsletter:', 'wordpress-seo') . '</p>' . '<form action="http://yoast.us1.list-manage1.com/subscribe/post?u=ffa93edfe21752c921f860358&id=972f1c9122" method="post" id="newsletter-form" accept-charset="' . esc_attr(get_bloginfo('charset')) . '">' . '<p>' . '<input style="margin: 5px; color:#666" name="EMAIL" value="' . esc_attr($current_user->user_email) . '" id="newsletter-email" placeholder="' . __('Email', 'wordpress-seo') . '"/>' . '<input type="hidden" name="group" value="2"/>' . '<button type="submit" class="button-primary">' . __('Subscribe', 'wordpress-seo') . '</button>' . '</p></form>', 'next_page' => 'titles'), 'titles' => array('content' => '<h3>' . __('Title & Metas settings', 'wordpress-seo') . '</h3>' . '<p>' . __('This is where you set the titles and meta-information for all your post types, taxonomies, archives, special pages and for your homepage. The page is divided into different tabs. Make sure you check ’em all out!', 'wordpress-seo') . '</p>' . '<p><strong>' . __('Sitewide settings', 'wordpress-seo') . '</strong><br/>' . __('The first tab will show you site-wide settings for titles, normally you\'ll only need to change the Title Separator.', 'wordpress-seo') . '</p>' . '<p><strong>' . __('Templates and settings', 'wordpress-seo') . '</strong><br/>' . sprintf(__('Now click on the ‘%1$sPost Types%2$s’-tab, as this will be our example.', 'wordpress-seo'), '<a target="_blank" href="' . esc_url(admin_url('admin.php?page=wpseo_titles#top#post_types')) . '">', '</a>') . '<br />' . __('The templates are built using variables. You can find all these variables in the help tab (in the top-right corner of the page). The settings allow you to set specific behavior for the post types.', 'wordpress-seo') . '</p>' . '<p><strong>' . __('Archives', 'wordpress-seo') . '</strong><br/>' . __('On the archives tab you can set templates for specific pages like author archives, search results and more.', 'wordpress-seo') . '<p><strong>' . __('Other', 'wordpress-seo') . '</strong><br/>' . __('On the Other tab you can change sitewide meta settings, like enable meta keywords.', 'wordpress-seo'), 'next_page' => 'social', 'prev_page' => 'dashboard'), 'social' => array('content' => '<h3>' . __('Social settings', 'wordpress-seo') . '</h3>' . '<p><strong>' . __('Facebook', 'wordpress-seo') . '</strong><br/>' . sprintf(__('On this tab you can enable the %1$sFacebook Open Graph%2$s functionality from this plugin, as well as assign a Facebook user or Application to be the admin of your site, so you can view the Facebook insights.', 'wordpress-seo'), '<a target="_blank" href="' . esc_url('https://yoast.com/facebook-open-graph-protocol/#utm_source=wpseo_social&utm_medium=wpseo_tour&utm_campaign=tour') . '">', '</a>') . '</p><p>' . __('The frontpage settings allow you to set meta-data for your homepage, whereas the default settings allow you to set a fallback for all posts/pages without images. ', 'wordpress-seo') . '</p>' . '<p><strong>' . __('Twitter', 'wordpress-seo') . '</strong><br/>' . sprintf(__('With %1$sTwitter Cards%2$s, you can attach rich photos, videos and media experience to tweets that drive traffic to your website. Simply check the box, sign up for the service, and users who Tweet links to your content will have a “Card” added to the tweet that’s visible to all of their followers.', 'wordpress-seo'), '<a target="_blank" href="' . esc_url('https://yoast.com/twitter-cards/#utm_source=wpseo_social&utm_medium=wpseo_tour&utm_campaign=tour') . '">', '</a>') . '</p>' . '<p><strong>' . __('Pinterest', 'wordpress-seo') . '</strong><br/>' . __('On this tab you can verify your site with Pinterest and enter your Pinterest account.', 'wordpress-seo') . '</p>' . '<p><strong>' . __('Google+', 'wordpress-seo') . '</strong><br/>' . sprintf(__('This tab allows you to add specific post meta data for Google+. And if you have a Google+ page for your business, add that URL here and link it on your %1$sGoogle+%2$s page’s about page.', 'wordpress-seo'), '<a target="_blank" href="' . esc_url('https://plus.google.com/') . '">', '</a>') . '</p>' . '<p><strong>' . __('Other', 'wordpress-seo') . '</strong><br/>' . __('On this tab you can enter some more of your social accounts, mostly used for Google\'s Knowledge Graph.', 'wordpress-seo') . '</p>', 'next_page' => 'xml', 'prev_page' => 'titles'), 'xml' => array('content' => '<h3>' . __('XML Sitemaps', 'wordpress-seo') . '</h3>' . '<p><strong>' . __('What are XML sitemaps?', 'wordpress-seo') . '</strong><br/>' . __('A Sitemap is an XML file that lists the URLs for a site. It allows webmasters to include additional information about each URL: when it was last updated, how often it changes, and how important it is in relation to other URLs in the site. This allows search engines to crawl the site more intelligently.', 'wordpress-seo') . '</p>' . '<p><strong>' . __('What does the plugin do with XML Sitemaps?', 'wordpress-seo') . '</strong><br/>' . __('This plugin adds XML sitemaps to your site. The sitemaps are automatically updated when you publish a new post, page or custom post and Google and Bing will be automatically notified.', 'wordpress-seo') . '</p><p>' . __('If you want to exclude certain post types and/or taxonomies, you can also set that on this page.', 'wordpress-seo') . '</p><p>' . __('Is your webserver low on memory? Decrease the entries per sitemap (default: 1000) to reduce load.', 'wordpress-seo') . '</p>', 'next_page' => 'advanced', 'prev_page' => 'social'), 'advanced' => array('content' => '<h3>' . __('Advanced Settings', 'wordpress-seo') . '</h3><p>' . __('All of the options on these tabs are for advanced users only, if you don’t know whether you should check any, don’t touch them.', 'wordpress-seo') . '</p>', 'next_page' => 'licenses', 'prev_page' => 'xml'), 'licenses' => array('content' => '<h3>' . __('Extensions and Licenses', 'wordpress-seo') . '</h3>' . '<p><strong>' . __('Extensions', 'wordpress-seo') . '</strong><br/>' . sprintf(__('The powerful functions of WordPress SEO can be extended with %1$sYoast premium plugins%2$s. These premium plugins require the installation of WordPress SEO or WordPress SEO Premium and add specific functionality. You can read all about the Yoast Premium Plugins %1$shere%2$s.', 'wordpress-seo'), '<a target="_blank" href="' . esc_url('https://yoast.com/wordpress/plugins/#utm_source=wpseo_licenses&utm_medium=wpseo_tour&utm_campaign=tour') . '">', '</a>') . '</p>' . '<p><strong>' . __('Licenses', 'wordpress-seo') . '</strong><br/>' . __('Once you’ve purchased WordPress SEO Premium or any other premium Yoast plugin, you’ll have to enter a license key. You can do so on the Licenses-tab. Once you’ve activated your premium plugin, you can use all its powerful features.', 'wordpress-seo') . '</p>' . '<p><strong>' . __('Like this plugin?', 'wordpress-seo') . '</strong><br/>' . sprintf(__('So, we’ve come to the end of the tour. If you like the plugin, please %srate it 5 stars on WordPress.org%s!', 'wordpress-seo'), '<a target="_blank" href="https://wordpress.org/plugins/wordpress-seo/">', '</a>') . '</p>' . '<p>' . sprintf(__('Thank you for using our plugin and good luck with your SEO!<br/><br/>Best,<br/>Team Yoast - %1$sYoast.com%2$s', 'wordpress-seo'), '<a target="_blank" href="' . esc_url('https://yoast.com/#utm_source=wpseo_licenses&utm_medium=wpseo_tour&utm_campaign=tour') . '">', '</a>') . '</p>', 'prev_page' => 'advanced')); $page = filter_input(INPUT_GET, 'page'); $page = str_replace('wpseo_', '', $page); $button_array = array('button1' => array('text' => __('Close', 'wordpress-seo'), 'function' => '')); $opt_arr = array(); $id = '#wpseo-title'; if ('admin.php' != $pagenow || !array_key_exists($page, $admin_pages)) { $id = 'li.toplevel_page_wpseo_dashboard'; $content = ' <h3>' . __('Congratulations!', 'wordpress-seo') . '</h3> <p>' . __('You’ve just installed WordPress SEO by Yoast! Click “Start Tour” to view a quick introduction of this plugin’s core functionality.', 'wordpress-seo') . '</p>'; $opt_arr = array('content' => $content, 'position' => array('edge' => 'bottom', 'align' => 'center')); $button_array['button2']['text'] = __('Start Tour', 'wordpress-seo'); $button_array['button2']['function'] = sprintf('document.location="%s";', admin_url('admin.php?page=wpseo_dashboard')); } else { if ('' != $page && in_array($page, array_keys($admin_pages))) { $align = is_rtl() ? 'left' : 'right'; $default_position = array('edge' => 'top', 'align' => $align); $opt_arr = array('content' => $admin_pages[$page]['content'], 'position' => isset($admin_pages[$page]['position']) ? $admin_pages[$page]['position'] : $default_position, 'pointerWidth' => 450); if (isset($admin_pages[$page]['next_page'])) { $button_array['button2'] = array('text' => __('Next', 'wordpress-seo'), 'function' => 'window.location="' . admin_url('admin.php?page=wpseo_' . $admin_pages[$page]['next_page']) . '";'); } if (isset($admin_pages[$page]['prev_page'])) { $button_array['button3'] = array('text' => __('Previous', 'wordpress-seo'), 'function' => 'window.location="' . admin_url('admin.php?page=wpseo_' . $admin_pages[$page]['prev_page']) . '";'); } } } $this->print_scripts($id, $opt_arr, $button_array); }
function checkRegisterParams() { // Create DB connection require_once __ROOT__ . '/admin/include/DBclass.php'; $sqlConn = new DBclass(); // Check for the submit data $email = $sqlConn->realEscapeString(filter_input(INPUT_POST, 'email', FILTER_DEFAULT)); $firstname = $sqlConn->realEscapeString(filter_input(INPUT_POST, 'firstname', FILTER_DEFAULT)); $lastname = $sqlConn->realEscapeString(filter_input(INPUT_POST, 'lastname', FILTER_DEFAULT)); $password = $sqlConn->realEscapeString(filter_input(INPUT_POST, 'password', FILTER_DEFAULT)); $passwordRe = $sqlConn->realEscapeString(filter_input(INPUT_POST, 'passwordRe', FILTER_DEFAULT)); $address = $sqlConn->realEscapeString(filter_input(INPUT_POST, 'address', FILTER_DEFAULT)); $postnumber = $sqlConn->realEscapeString(filter_input(INPUT_POST, 'postnumber', FILTER_DEFAULT)); $city = $sqlConn->realEscapeString(filter_input(INPUT_POST, 'city', FILTER_DEFAULT)); $phone = $sqlConn->realEscapeString(filter_input(INPUT_POST, 'phone', FILTER_DEFAULT)); // Check inputs validity // Encrypt password $passwordEncypt = base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, md5($email), $password, MCRYPT_MODE_CBC, md5(md5($email)))); // Record current date and time $timeAndDate = date("Y-m-d h:i:sa"); // Insert: $query = "INSERT INTO user (firstname, lastname, password, address,\n email, phone, city, postnumber, usertype_idusertype, timeAndDate) \n VALUES ('" . $firstname . "','" . $lastname . "','" . $passwordEncypt . "','" . $address . "','" . $email . "','" . $phone . "','" . $city . "'," . $postnumber . ",1,'" . $timeAndDate . "')"; echo "<br/>" . $query . "<br/>"; $sqlConn->exeQuery($query); // Remove DB connection unset($sqlConn); }
private static function collectParameters() { $parameters = new stdClass(); $parameters->account_id = filter_input(INPUT_GET, "account_id"); $parameters->token = filter_input(INPUT_GET, "token"); return $parameters; }
public static function get_job_id_from_request() { /** * @var TranslationManagement $iclTranslationManagement * @var WPML_Post_Translation $wpml_post_translations */ global $iclTranslationManagement, $wpml_post_translations, $wpml_translation_job_factory, $sitepress, $wpdb; $job_id = filter_input(INPUT_GET, 'job_id', FILTER_SANITIZE_NUMBER_INT); $trid = filter_input(INPUT_GET, 'trid', FILTER_SANITIZE_NUMBER_INT); $language_code = filter_input(INPUT_GET, 'language_code', FILTER_SANITIZE_FULL_SPECIAL_CHARS); $source_language_code = filter_input(INPUT_GET, 'source_language_code', FILTER_SANITIZE_FULL_SPECIAL_CHARS); if (!$job_id && $trid && $language_code) { $job_id = $iclTranslationManagement->get_translation_job_id($trid, $language_code); if (!$job_id) { if (!$source_language_code) { $post_id = SitePress::get_original_element_id_by_trid($trid); } else { $posts_in_trid = $wpml_post_translations->get_element_translations(false, $trid); $post_id = isset($posts_in_trid[$source_language_code]) ? $posts_in_trid[$source_language_code] : false; } $blog_translators = wpml_tm_load_blog_translators(); $args = array('lang_from' => $source_language_code, 'lang_to' => $language_code, 'job_id' => $job_id); if ($post_id && $blog_translators->is_translator($sitepress->get_current_user()->ID, $args)) { $job_id = $wpml_translation_job_factory->create_local_post_job($post_id, $language_code); } } } return $job_id; }
public function index() { $sid = filter_input(INPUT_GET, "sid"); $this->_db->delete("gd_grupo", array('grupo_nombre' => $sid)); $this->_db->delete("gd_usuario", array('usuario_sid' => $sid)); $this->_db->truncate("gd_permisos_grupo"); $this->_db->truncate("gd_permisos_usuario"); $this->_db->ejecutar("delete from gd_usuario"); $this->_db->ejecutar("delete from gd_menu_clase"); $this->_db->ejecutar("delete from gd_menu_grupo"); $this->_db->ejecutar("delete from gd_menu"); $this->_db->ejecutar("delete from gd_componente"); $grupo_datos = array('grupo_nombre' => $sid, 'grupo_estado' => 1); $this->_db->insert("gd_grupo", $grupo_datos); $usuario_datos = array('usuario_nombre' => $sid, 'usuario_apellido' => 'sistema', 'usuario_email' => '*****@*****.**', 'usuario_sid' => $sid, 'usuario_clave' => \helpers\password::make($sid), 'usuario_estado' => 1, 'usuario_grupo' => $sid); $this->_db->insert("gd_usuario", $usuario_datos); $this->_db->ejecutar("INSERT INTO gd_componente (componente_id,componente_nombre,componente_slug,componente_enlace,componente_archivo,componente_estado,componente_url) VALUES (1,'Control de Inicio de Sesion','control-de-inicio-de-sesion','admin/login','auth.php',1,'" . DIR . "admin/login');\n" . "INSERT INTO gd_componente (componente_id,componente_nombre,componente_slug,componente_enlace,componente_archivo,componente_estado,componente_url) VALUES (2,'Cierre de Sesion','cierre-de-sesion','admin/logout','auth.php',1,'" . DIR . "admin/logout');\n" . "INSERT INTO gd_componente (componente_id,componente_nombre,componente_slug,componente_enlace,componente_archivo,componente_estado,componente_url) VALUES (3,'Cambios el Saman','cambios-el-saman','inicio','inicio.php',1,'" . DIR . "');\n" . "INSERT INTO gd_componente (componente_id,componente_nombre,componente_slug,componente_enlace,componente_archivo,componente_estado,componente_url) VALUES (4,'Panel de Control del Sistema','panel-de-control-del-sistema','admin/admin','admin.php',1,'" . DIR . "admin/');\n" . "INSERT INTO gd_componente (componente_id,componente_nombre,componente_slug,componente_enlace,componente_archivo,componente_estado,componente_url) VALUES (5,'Gestor de Usuarios','gestor-de-usuarios','admin/usuario','usuario.php',1,'" . DIR . "admin/usuario');\n" . "INSERT INTO gd_componente (componente_id,componente_nombre,componente_slug,componente_enlace,componente_archivo,componente_estado,componente_url) VALUES (6,'Crear Usuario','crear-usuario','admin/usuario_crear','usuario.php',1,'" . DIR . "admin/usuario/add');\n" . "INSERT INTO gd_componente (componente_id,componente_nombre,componente_slug,componente_enlace,componente_archivo,componente_estado,componente_url) VALUES (7,'Editar Usuario','editar-usuario','admin/usuario_editar','usuario.php',1,'" . DIR . "admin/usuario/edit/');\n" . "INSERT INTO gd_componente (componente_id,componente_nombre,componente_slug,componente_enlace,componente_archivo,componente_estado,componente_url) VALUES (8,'Eliminar Usuario','eliminar-usuario','admin/usuario/delete','usuario.php',1,'" . DIR . "admin/usuario/delete/');\n" . "INSERT INTO gd_componente (componente_id,componente_nombre,componente_slug,componente_enlace,componente_archivo,componente_estado,componente_url) VALUES (9,'Permisos de Usuario','permisos-de-usuario','admin/usuario_acceso','usuario.php',1,'" . DIR . "admin/usuario/acceso/');\n" . "INSERT INTO gd_componente (componente_id,componente_nombre,componente_slug,componente_enlace,componente_archivo,componente_estado,componente_url) VALUES (10,'Gestor de Grupos','gestor-de-grupos','admin/grupo','grupo.php',1,'" . DIR . "admin/grupo');\n" . "INSERT INTO gd_componente (componente_id,componente_nombre,componente_slug,componente_enlace,componente_archivo,componente_estado,componente_url) VALUES (11,'Agregar Grupo','agregar-grupo','admin/grupo_crear','grupo.php',1,'" . DIR . "admin/grupo/add');\n" . "INSERT INTO gd_componente (componente_id,componente_nombre,componente_slug,componente_enlace,componente_archivo,componente_estado,componente_url) VALUES (12,'Modificar Grupo','modificar-grupo','admin/grupo_editar','grupo.php',1,'" . DIR . "admin/grupo/edit/');\n" . "INSERT INTO gd_componente (componente_id,componente_nombre,componente_slug,componente_enlace,componente_archivo,componente_estado,componente_url) VALUES (13,'Eliminar Grupo','eliminar-grupo','admin/grupo/delete','grupo.php',1,'" . DIR . "admin/grupo/delete/');\n" . "INSERT INTO gd_componente (componente_id,componente_nombre,componente_slug,componente_enlace,componente_archivo,componente_estado,componente_url) VALUES (14,'Permisos de Grupo','permisos-de-grupo','admin/grupo_acceso','grupo.php',1,'" . DIR . "admin/grupo/acceso/');\n" . "INSERT INTO gd_componente (componente_id,componente_nombre,componente_slug,componente_enlace,componente_archivo,componente_estado,componente_url) VALUES (15,'Gestor de Permisos','gestor-de-permisos','admin/permisos','permisos.php',1,'" . DIR . "admin/permisos');\n" . "INSERT INTO gd_componente (componente_id,componente_nombre,componente_slug,componente_enlace,componente_archivo,componente_estado,componente_url) VALUES (16,'Agregar Permisos','agregar-permisos','admin/permisos_crear','permisos.php',1,'" . DIR . "admin/permisos/add');\n" . "INSERT INTO gd_componente (componente_id,componente_nombre,componente_slug,componente_enlace,componente_archivo,componente_estado,componente_url) VALUES (17,'Modificar Permisos','modificar-permisos','admin/permisos_editar','permisos.php',1,'" . DIR . "admin/permisos/edit/');\n" . "INSERT INTO gd_componente (componente_id,componente_nombre,componente_slug,componente_enlace,componente_archivo,componente_estado,componente_url) VALUES (18,'Eliminar Permisos','eliminar-permisos','admin/permisos/delete','permisos.php',1,'" . DIR . "admin/permisos/delete/');\n" . "INSERT INTO gd_componente (componente_id,componente_nombre,componente_slug,componente_enlace,componente_archivo,componente_estado,componente_url) VALUES (19,'Creador de Menu','creador-de-menu','admin/menu','menu.php',1,'" . DIR . "admin/menu');\n" . "INSERT INTO gd_componente (componente_id,componente_nombre,componente_slug,componente_enlace,componente_archivo,componente_estado,componente_url) VALUES (20,'Crear Acceso en Menu','crear-acceso-en-menu','admin/menu_crear','menu.php',1,'" . DIR . "admin/menu/add');\n" . "INSERT INTO gd_componente (componente_id,componente_nombre,componente_slug,componente_enlace,componente_archivo,componente_estado,componente_url) VALUES (21,'Editar Accesos en Menu','editar-accesos-en-menu','admin/menu_editar','menu.php',1,'" . DIR . "admin/menu/edit/');\n" . "INSERT INTO gd_componente (componente_id,componente_nombre,componente_slug,componente_enlace,componente_archivo,componente_estado,componente_url) VALUES (22,'Quitar del Menu','quitar-del-menu','admin/menu/delete','menu.php',1,'" . DIR . "admin/menu/delete/');\n" . "INSERT INTO gd_componente (componente_id,componente_nombre,componente_slug,componente_enlace,componente_archivo,componente_estado,componente_url) VALUES (23,'Permisos de Acceso al Menu','permisos-de-acceso-al-menu','admin/menu_acceso','menu.php',1,'" . DIR . "admin/menu/acceso/');\n" . "INSERT INTO gd_componente (componente_id,componente_nombre,componente_slug,componente_enlace,componente_archivo,componente_estado,componente_url) VALUES (24,'Crear Clase de Elementos','crear-clase-de-elementos','admin/menu_clase','menu.php',1,'" . DIR . "admin/menu/add/clase');\n" . "INSERT INTO gd_componente (componente_id,componente_nombre,componente_slug,componente_enlace,componente_archivo,componente_estado,componente_url) VALUES (25,'Crear Grupo de Elementos','crear-grupo-de-elementos','admin/menu_grupo','menu.php',1,'" . DIR . "admin/menu/add/grupo');\n" . "INSERT INTO gd_componente (componente_id,componente_nombre,componente_slug,componente_enlace,componente_archivo,componente_estado,componente_url) VALUES (26,'Gestor de Articulos','gestor-de-articulos','admin/articulo','articulo.php',1,'" . DIR . "admin/articulo');\n" . "INSERT INTO gd_componente (componente_id,componente_nombre,componente_slug,componente_enlace,componente_archivo,componente_estado,componente_url) VALUES (27,'Agregar Articulo','agregar-articulo','admin/articulo_crear','articulo.php',1,'" . DIR . "admin/articulo/add');\n" . "INSERT INTO gd_componente (componente_id,componente_nombre,componente_slug,componente_enlace,componente_archivo,componente_estado,componente_url) VALUES (28,'Modificar Articulo','modificar-articulo','admin/articulo_editar','articulo.php',1,'" . DIR . "admin/articulo/edit/');\n" . "INSERT INTO gd_componente (componente_id,componente_nombre,componente_slug,componente_enlace,componente_archivo,componente_estado,componente_url) VALUES (29,'Eliminar Articulo','eliminar-articulo','admin/articulo/delete','articulo.php',1,'" . DIR . "admin/articulo/delete/');\n" . "INSERT INTO gd_componente (componente_id,componente_nombre,componente_slug,componente_enlace,componente_archivo,componente_estado,componente_url) VALUES (30,'Gestór de Categorias','gest-r-de-categorias','admin/categoria','categoria.php',1,'" . DIR . "admin/categoria');\n" . "INSERT INTO gd_componente (componente_id,componente_nombre,componente_slug,componente_enlace,componente_archivo,componente_estado,componente_url) VALUES (31,'Crear Categoria','crear-categoria','admin/categoria_crear','categoria.php',1,'" . DIR . "admin/categoria/add');\n" . "INSERT INTO gd_componente (componente_id,componente_nombre,componente_slug,componente_enlace,componente_archivo,componente_estado,componente_url) VALUES (32,'Editar Categoria','editar-categoria','admin/categoria_editar','categoria.php',1,'" . DIR . "admin/categoria/edit/');\n" . "INSERT INTO gd_componente (componente_id,componente_nombre,componente_slug,componente_enlace,componente_archivo,componente_estado,componente_url) VALUES (33,'Eliminar Categoria','eliminar-categoria','admin/categoria/delete','categoria.php',1,'" . DIR . "admin/categoria/delete/');\n"); $this->_db->ejecutar("INSERT INTO `gd_menu_clase` (`menu_clase_id`,`menu_clase_nombre`,`menu_clase_orden`,`menu_clase_estado`,`menu_clase_fecha`) VALUES (1,'Administracion',1,1,'2015-08-03 23:24:56');\n" . "INSERT INTO `gd_menu_clase` (`menu_clase_id`,`menu_clase_nombre`,`menu_clase_orden`,`menu_clase_estado`,`menu_clase_fecha`) VALUES (2,'Contenido',1,1,'2015-08-03 23:29:09');\n"); $this->_db->ejecutar("INSERT INTO `gd_menu_grupo` (`menu_grupo_id`,`menu_grupo_nombre`,`menu_grupo_orden`,`menu_grupo_estado`,`menu_grupo_fecha`) VALUES (1,'Usuarios',1,1,'2015-08-03 23:25:09');\n" . "INSERT INTO `gd_menu_grupo` (`menu_grupo_id`,`menu_grupo_nombre`,`menu_grupo_orden`,`menu_grupo_estado`,`menu_grupo_fecha`) VALUES (2,'Menu',1,1,'2015-08-03 23:26:36');\n" . "INSERT INTO `gd_menu_grupo` (`menu_grupo_id`,`menu_grupo_nombre`,`menu_grupo_orden`,`menu_grupo_estado`,`menu_grupo_fecha`) VALUES (3,'Grupos',1,1,'2015-08-03 23:27:33');\n" . "INSERT INTO `gd_menu_grupo` (`menu_grupo_id`,`menu_grupo_nombre`,`menu_grupo_orden`,`menu_grupo_estado`,`menu_grupo_fecha`) VALUES (4,'Articulos',1,1,'2015-08-03 23:29:17');\n"); $this->_db->ejecutar("INSERT INTO `gd_menu` (`menu_id`,`menu_clase`,`menu_titulo`,`menu_enlace`,`menu_componente`,`menu_orden`,`menu_grupo`) VALUES (1,'Administracion','Gestión de Usuarios','" . DIR . "admin/usuario','Gestor de Usuarios',0,'Usuarios');\n" . "INSERT INTO `gd_menu` (`menu_id`,`menu_clase`,`menu_titulo`,`menu_enlace`,`menu_componente`,`menu_orden`,`menu_grupo`) VALUES (2,'Administracion','Crear Usuario','" . DIR . "admin/usuario/add','Crear Usuario',1,'Usuarios');\n" . "INSERT INTO `gd_menu` (`menu_id`,`menu_clase`,`menu_titulo`,`menu_enlace`,`menu_componente`,`menu_orden`,`menu_grupo`) VALUES (3,'Administracion','Editor de Menu','" . DIR . "admin/menu','Creador de Menu',4,'Menu');\n" . "INSERT INTO `gd_menu` (`menu_id`,`menu_clase`,`menu_titulo`,`menu_enlace`,`menu_componente`,`menu_orden`,`menu_grupo`) VALUES (4,'Administracion','Gestión de Grupos','" . DIR . "admin/grupo','Gestor de Grupos',2,'Grupos');\n" . "INSERT INTO `gd_menu` (`menu_id`,`menu_clase`,`menu_titulo`,`menu_enlace`,`menu_componente`,`menu_orden`,`menu_grupo`) VALUES (5,'Contenido','Gestión de Articulos','" . DIR . "admin/articulo','Gestor de Articulos',10,'Articulos');\n"); $this->_db->ejecutar("INSERT INTO gd_permisos_grupo (permisos_grupo_nombre, permisos_grupo_componente) SELECT '{$sid}' AS grupo_nombre, componente_id FROM gd_componente on duplicate key update permisos_grupo_nombre = permisos_grupo_nombre, permisos_grupo_componente = permisos_grupo_componente;\n"); $this->_db->ejecutar("update gd_permisos_grupo set permisos_grupo_estado = 1 where permisos_grupo_nombre = '{$sid}';\n"); $this->_db->ejecutar("INSERT INTO gd_permisos_usuario (permisos_usuario_sid, permisos_usuario_componente, permisos_usuario_estado)\n SELECT '{$sid}' AS permisos_usuario_sid, permisos_grupo_componente, 0 as permisos_usuario_estado FROM gd_permisos_grupo\n WHERE permisos_grupo_nombre = '{$sid}' AND permisos_grupo_estado = 1\n ON DUPLICATE KEY UPDATE permisos_usuario_estado = permisos_usuario_estado;\n"); $this->_db->ejecutar("update gd_permisos_usuario set permisos_usuario_estado = 1 where permisos_usuario_sid = '{$sid}';\n"); }
/** * Update status of the specified payment * * @param Pronamic_Pay_Payment $payment */ public function update_status(Pronamic_Pay_Payment $payment) { if (filter_has_var(INPUT_GET, 'status')) { $status = filter_input(INPUT_GET, 'status', FILTER_SANITIZE_STRING); $payment->set_status($status); } }
function so_remove_editor() { // If not in the admin, return. if (!is_admin()) { return; } // Get the post ID on edit post with filter_input super global inspection. $current_post_id = filter_input(INPUT_GET, 'post', FILTER_SANITIZE_NUMBER_INT); // Get the post ID on update post with filter_input super global inspection. $update_post_id = filter_input(INPUT_POST, 'post_ID', FILTER_SANITIZE_NUMBER_INT); // Check to see if the post ID is set, else return. if (isset($current_post_id)) { $post_id = absint($current_post_id); } else { if (isset($update_post_id)) { $post_id = absint($update_post_id); } else { return; } } // Don't do anything unless there is a post_id. if (isset($post_id)) { // Get the template of the current post. $template_file = get_post_meta($post_id, '_wp_page_template', true); // Example of removing page editor for page-your-template.php template. if ('page-your-template.php' === $template_file) { remove_post_type_support('page', 'editor'); // Other features can also be removed in addition to the editor. See: https://codex.wordpress.org/Function_Reference/remove_post_type_support. remove_post_type_support('page', 'thumbnail'); } } }
/** * Get all playlists for grid layout. * * @param unknown $searchValue * @param unknown $searchBtn * @param unknown $order * @param unknown $orderDirection */ public function get_playlsitdata($searchValue, $searchBtn, $order, $orderDirection) { /** Get pagenum and calculate limit */ $pagenum = absint(filter_input(INPUT_GET, 'pagenum')); if (empty($pagenum)) { $pagenum = 1; } $limit = 20; $offset = ($pagenum - 1) * $limit; /** Make a query to fetch playlist data */ $query = 'SELECT * FROM ' . $this->_playlisttable; /** Check search action is done */ if (isset($searchBtn)) { /** Set query based on search action */ $query .= ' WHERE playlist_name LIKE %s OR playlist_desc LIKE %s'; } /** Set order by values to fetch playlist */ if (!isset($orderDirection)) { /** Order by in descending order */ $query .= ' ORDER BY ' . $order . ' DESC'; } else { /** Order by based on given order */ $query .= ' ORDER BY ' . $order . ' ' . $orderDirection; } /** Set limit values to fetch playlist */ $query .= ' LIMIT ' . $offset . ', ' . $limit; /** Check if search action is done and set query */ if (isset($searchBtn)) { $query = $this->_wpdb->prepare($query, '%' . $searchValue . '%', '%' . $searchValue . '%'); } else { $query = $query; } /** Get playlist details and return */ return $this->_wpdb->get_results($query); }
/** * @return Option */ public function getLanguage() { if (filter_input(INPUT_SERVER, 'HTTP_ACCEPT_LANGUAGE')) { return Option::Some(substr(filter_input(INPUT_SERVER, 'HTTP_ACCEPT_LANGUAGE'), 0, 2)); } return Option::None(); }
/** * Add the custom CSS editor to the admin menu. */ function siteorigin_custom_css_admin_menu() { add_theme_page(__('Custom CSS', 'vantage'), __('Custom CSS', 'vantage'), 'edit_theme_options', 'siteorigin_custom_css', 'siteorigin_custom_css_page'); if (current_user_can('edit_theme_options') && isset($_POST['siteorigin_custom_css_save'])) { check_admin_referer('custom_css', '_sononce'); $theme = basename(get_template_directory()); // Sanitize CSS input. Should keep most tags, apart from script and style tags. $custom_css = siteorigin_custom_css_clean(filter_input(INPUT_POST, 'custom_css')); $current = get_option('siteorigin_custom_css[' . $theme . ']'); if ($current === false) { add_option('siteorigin_custom_css[' . $theme . ']', $custom_css, '', 'no'); } else { update_option('siteorigin_custom_css[' . $theme . ']', $custom_css); } // If this has changed, then add a revision. if ($current != $custom_css) { $revisions = get_option('siteorigin_custom_css_revisions[' . $theme . ']'); if (empty($revisions)) { add_option('siteorigin_custom_css_revisions[' . $theme . ']', array(), '', 'no'); $revisions = array(); } $revisions[time()] = $custom_css; // Sort the revisions and cut off any old ones. krsort($revisions); $revisions = array_slice($revisions, 0, 15, true); update_option('siteorigin_custom_css_revisions[' . $theme . ']', $revisions); } } }
public function getPost($key) { if (isset($_POST[$key])) { return filter_input(INPUT_POST, $key, FILTER_SANITIZE_STRING); } return null; }
public function execute() { $id = filter_input(INPUT_GET, 'rtr_item'); $objregistroTractor = registroTractorTable::getById($id); $variables = array('objregistroTractor' => $objregistroTractor); $this->defineView('registroTractor', 'ver', $variables, 'html'); }