当前位置: 首页>>代码示例>>PHP>>正文


PHP http::redirect方法代码示例

本文整理汇总了PHP中http::redirect方法的典型用法代码示例。如果您正苦于以下问题:PHP http::redirect方法的具体用法?PHP http::redirect怎么用?PHP http::redirect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在http的用法示例。


在下文中一共展示了http::redirect方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 /**
  * Constructor.
  *
  */
 public function __construct($okt)
 {
     $this->okt = $okt;
     // TODO : idéalement il faudrait faire des redirections vers la page demandée dans la langue demandée
     //$this->sRequestedLanguage = $this->setUserRequestLanguage();
     if ($this->setUserRequestLanguage()) {
         http::redirect($this->okt->page->getBaseUrl());
     }
 }
开发者ID:jewelhuq,项目名称:okatea,代码行数:13,代码来源:class.oktController.php

示例2: checkSuper

 public static function checkSuper()
 {
     global $core;
     if (!$core->auth->isSuperAdmin()) {
         if (session_id()) {
             $core->session->destroy();
         }
         http::redirect(DC_AUTH_PAGE);
     }
 }
开发者ID:nikrou,项目名称:dotclear,代码行数:10,代码来源:lib.dc.page.php

示例3: gui

 public function gui($url)
 {
     # Create list
     if (!empty($_POST['createlist'])) {
         try {
             $this->defaultWordsList();
             http::redirect($url . '&list=1');
         } catch (Exception $e) {
             $this->okt->error->set($e->getMessage());
         }
     }
     # Adding a word
     if (!empty($_POST['swa'])) {
         try {
             $this->addRule($_POST['swa']);
             http::redirect($url . '&added=1');
         } catch (Exception $e) {
             $okt->error->add($e->getMessage());
         }
     }
     # Removing spamwords
     if (!empty($_POST['swd']) && is_array($_POST['swd'])) {
         try {
             $this->removeRule($_POST['swd']);
             http::redirect($url . '&removed=1');
         } catch (Exception $e) {
             $okt->error->add($e->getMessage());
         }
     }
     /* DISPLAY
     		---------------------------------------------- */
     global $okt;
     $okt->page->messages->success('list', __('m_antispam_Words_successfully_added'));
     $okt->page->messages->success('added', __('m_antispam_Word_successfully_added'));
     $okt->page->messages->success('removed', __('m_antispam_Words_successfully_removed'));
     $res = '';
     $res .= '<form action="' . html::escapeURL($url) . '" method="post">' . '<fieldset><legend>' . __('m_antispam_Add_word') . '</legend>' . '<p>' . form::text('swa', 20, 128) . ' ';
     $res .= adminPage::formtoken() . '<input type="submit" value="' . __('c_c_action_Add') . '"/></p>' . '</fieldset>' . '</form>';
     $rs = $this->getRules();
     if ($rs->isEmpty()) {
         $res .= '<p><strong>' . __('m_antispam_No_word_in_list') . '</strong></p>';
     } else {
         $res .= '<form action="' . html::escapeURL($url) . '" method="post">' . '<fieldset><legend>' . __('m_antispam_List') . '</legend>' . '<div style="' . $this->style_list . '">';
         while ($rs->fetch()) {
             $disabled_word = false;
             $p_style = $this->style_p;
             $res .= '<p style="' . $p_style . '"><label class="classic">' . form::checkbox(array('swd[]'), $rs->rule_id, false) . ' ' . html::escapeHTML($rs->rule_content) . '</label></p>';
         }
         $res .= '</div>' . '<p>' . form::hidden(array('spamwords'), 1) . adminPage::formtoken() . '<input type="submit" value="' . __('m_antispam_Delete_selected_words') . '"/></p>' . '</fieldset></form>';
     }
     $res .= '<form action="' . html::escapeURL($url) . '" method="post">' . '<p><input type="submit" value="' . __('m_antispam_Create_default_wordlist') . '" />' . form::hidden(array('spamwords'), 1) . form::hidden(array('createlist'), 1) . adminPage::formtoken() . '</p>' . '</form>';
     return $res;
 }
开发者ID:jewelhuq,项目名称:okatea,代码行数:53,代码来源:class.filter.words.php

示例4: process

 public function process($do)
 {
     if ($do == 'ok') {
         $this->status = true;
         return;
     }
     if (empty($_POST['feed_url'])) {
         return;
     }
     $this->feed_url = $_POST['feed_url'];
     $feed = feedReader::quickParse($this->feed_url);
     if ($feed === false) {
         throw new Exception(__('Cannot retrieve feed URL.'));
     }
     if (count($feed->items) == 0) {
         throw new Exception(__('No items in feed.'));
     }
     if ($this->core->plugins->moduleExists('metadata')) {
         $meta = new dcMeta($this->core);
     }
     $cur = $this->core->con->openCursor($this->core->prefix . 'post');
     $this->core->con->begin();
     foreach ($feed->items as $item) {
         $cur->clean();
         $cur->user_id = $this->core->auth->userID();
         $cur->post_content = $item->content ? $item->content : $item->description;
         $cur->post_title = $item->title ? $item->title : text::cutString(html::clean($cur->post_content), 60);
         $cur->post_format = 'xhtml';
         $cur->post_status = -2;
         $cur->post_dt = strftime('%Y-%m-%d %H:%M:%S', $item->TS);
         try {
             $post_id = $this->core->blog->addPost($cur);
         } catch (Exception $e) {
             $this->core->con->rollback();
             throw $e;
         }
         if (isset($meta)) {
             foreach ($item->subject as $subject) {
                 $meta->setPostMeta($post_id, 'tag', dcMeta::sanitizeMetaID($subject));
             }
         }
     }
     $this->core->con->commit();
     http::redirect($this->getURL() . '&do=ok');
 }
开发者ID:HackerMajor,项目名称:root,代码行数:45,代码来源:class.dc.import.feed.php

示例5: gui

 public function gui($url)
 {
     $bls = $this->getServers();
     if (isset($_POST['bls'])) {
         try {
             $this->core->blog->settings->setNameSpace('antispam');
             $this->core->blog->settings->put('antispam_dnsbls', $_POST['bls'], 'string', 'Antispam DNSBL servers', true, false);
             http::redirect($url . '&upd=1');
         } catch (Exception $e) {
             $core->error->add($e->getMessage());
         }
     }
     /* DISPLAY
     		---------------------------------------------- */
     $res = '';
     $res .= '<form action="' . html::escapeURL($url) . '" method="post">' . '<fieldset><legend>' . __('IP Lookup servers') . '</legend>' . '<p>' . __('Add here a coma separated list of servers.') . '</p>' . '<p>' . form::textarea('bls', 40, 3, html::escapeHTML($bls), 'maximal') . '</p>' . '<p><input type="submit" value="' . __('Save') . '" />' . $this->core->formNonce() . '</p>' . '</fieldset>' . '</form>';
     return $res;
 }
开发者ID:HackerMajor,项目名称:root,代码行数:18,代码来源:class.dc.filter.iplookup.php

示例6: gui

 public function gui($url)
 {
     $bls = $this->getServers();
     if (isset($_POST['bls'])) {
         try {
             $this->core->blog->settings->addNamespace('antispam');
             $this->core->blog->settings->antispam->put('antispam_dnsbls', $_POST['bls'], 'string', 'Antispam DNSBL servers', true, false);
             dcPage::addSuccessNotice(__('The list of DNSBL servers has been succesfully updated.'));
             http::redirect($url);
         } catch (Exception $e) {
             $core->error->add($e->getMessage());
         }
     }
     /* DISPLAY
     		---------------------------------------------- */
     $res = dcPage::notices();
     $res .= '<form action="' . html::escapeURL($url) . '" method="post" class="fieldset">' . '<h3>' . __('IP Lookup servers') . '</h3>' . '<p><label for="bls">' . __('Add here a coma separated list of servers.') . '</label>' . form::textarea('bls', 40, 3, html::escapeHTML($bls), 'maximal') . '</p>' . '<p><input type="submit" value="' . __('Save') . '" />' . $this->core->formNonce() . '</p>' . '</form>';
     return $res;
 }
开发者ID:nikrou,项目名称:dotclear,代码行数:19,代码来源:class.dc.filter.iplookup.php

示例7: gui

 public function gui($url)
 {
     global $default_tab;
     $core =& $this->core;
     # Set current type and tab
     $ip_type = 'black';
     if (!empty($_REQUEST['ip_type']) && $_REQUEST['ip_type'] == 'white') {
         $ip_type = 'white';
     }
     $default_tab = 'tab_' . $ip_type;
     # Add IP to list
     if (!empty($_POST['addip'])) {
         try {
             $global = !empty($_POST['globalip']) && $core->auth->isSuperAdmin();
             $this->addIP($ip_type, $_POST['addip'], $global);
             http::redirect($url . '&added=1&ip_type=' . $ip_type);
         } catch (Exception $e) {
             $core->error->add($e->getMessage());
         }
     }
     # Remove IP from list
     if (!empty($_POST['delip']) && is_array($_POST['delip'])) {
         try {
             $this->removeRule($_POST['delip']);
             http::redirect($url . '&removed=1&ip_type=' . $ip_type);
         } catch (Exception $e) {
             $core->error->add($e->getMessage());
         }
     }
     /* DISPLAY
     		---------------------------------------------- */
     $res = '';
     if (!empty($_GET['added'])) {
         $res .= '<p class="message">' . __('IP address has been successfully added.') . '</p>';
     }
     if (!empty($_GET['removed'])) {
         $res .= '<p class="message">' . __('IP addresses have been successfully removed.') . '</p>';
     }
     $res .= $this->displayForms($url, 'black', __('Blacklist')) . $this->displayForms($url, 'white', __('Whitelist'));
     return $res;
 }
开发者ID:HackerMajor,项目名称:root,代码行数:41,代码来源:class.dc.filter.ip.php

示例8: catch

        }
        try {
            # --BEHAVIOR-- adminBeforeCommentUpdate
            $core->callBehavior('adminBeforeCommentUpdate', $cur, $comment_id);
            $core->blog->updComment($comment_id, $cur);
            # --BEHAVIOR-- adminAfterCommentUpdate
            $core->callBehavior('adminAfterCommentUpdate', $cur, $comment_id);
            http::redirect('comment.php?id=' . $comment_id . '&upd=1');
        } catch (Exception $e) {
            $core->error->add($e->getMessage());
        }
    }
    if (!empty($_POST['delete']) && $can_delete) {
        try {
            $core->blog->delComment($comment_id);
            http::redirect($core->getPostAdminURL($rs->post_type, $rs->post_id) . '&co=1#c' . $comment_id, false);
        } catch (Exception $e) {
            $core->error->add($e->getMessage());
        }
    }
    if (!$can_edit) {
        $core->error->add(__("You can't edit this comment."));
    }
}
/* DISPLAY
-------------------------------------------------------- */
dcPage::open(__('Edit comment'), dcPage::jsConfirmClose('comment-form') . dcPage::jsToolBar() . dcPage::jsLoad('js/_comment.js'));
if ($comment_id) {
    if (!empty($_GET['upd'])) {
        echo '<p class="message">' . __('Comment has been successfully updated.') . '</p>';
    }
开发者ID:HackerMajor,项目名称:root,代码行数:31,代码来源:comment.php

示例9: array

        $pings_uris = array();
    }
    if (isset($_POST['pings_srv_name'])) {
        $pings_srv_name = is_array($_POST['pings_srv_name']) ? $_POST['pings_srv_name'] : array();
        $pings_srv_uri = is_array($_POST['pings_srv_uri']) ? $_POST['pings_srv_uri'] : array();
        $pings_uris = array();
        foreach ($pings_srv_name as $k => $v) {
            if (trim($v) && trim($pings_srv_uri[$k])) {
                $pings_uris[trim($v)] = trim($pings_srv_uri[$k]);
            }
        }
        $core->blog->settings->addNamespace('pings');
        $core->blog->settings->pings->put('pings_active', !empty($_POST['pings_active']), null, null, true, true);
        $core->blog->settings->pings->put('pings_uris', serialize($pings_uris), null, null, true, true);
        dcPage::addSuccessNotice(__('Settings have been successfully updated.'));
        http::redirect($p_url);
    }
} catch (Exception $e) {
    $core->error->add($e->getMessage());
}
?>
<html>
<head>
  <title><?php 
echo __('Pings');
?>
</title>
</head>

<body>
<?php 
开发者ID:nikrou,项目名称:dotclear,代码行数:31,代码来源:index.php

示例10: galleriesGallery

 /**
  * Affichage d'une galerie.
  *
  */
 public function galleriesGallery($aMatches)
 {
     # module actuel
     $this->okt->page->module = 'galleries';
     $this->okt->page->action = 'gallery';
     # récupération de la galerie en fonction du slug
     if (!empty($aMatches[0])) {
         $slug = $aMatches[0];
     } else {
         $this->serve404();
     }
     # récupération de la galerie
     $rsGallery = $this->okt->galleries->tree->getGalleries(array('slug' => $slug, 'active' => 1, 'language' => $this->okt->user->language));
     if ($rsGallery->isEmpty()) {
         $this->serve404();
     }
     # formatage des données avant affichage
     $this->okt->galleries->tree->prepareGallery($rsGallery);
     # un mot de passe ?
     $bGalleryRequirePassword = false;
     if (!empty($rsGallery->password)) {
         # il y a un mot de passe en session
         if (!empty($_SESSION['okt_gallery_password_' . $rsGallery->id])) {
             if ($_SESSION['okt_gallery_password_' . $rsGallery->id] != $rsGallery->password) {
                 $this->okt->error->set('Le mot de passe ne correspond pas à celui de la galerie.');
                 $bGalleryRequirePassword = true;
             }
         } elseif (!empty($_POST['okt_gallery_password'])) {
             $p_password = trim($_POST['okt_gallery_password']);
             if ($p_password != $rsGallery->password) {
                 $this->okt->error->set('Le mot de passe ne correspond pas à celui de la galerie.');
                 $bGalleryRequirePassword = true;
             } else {
                 $_SESSION['okt_gallery_password_' . $rsGallery->id] = $p_password;
                 http::redirect(html::escapeHTML($rsGallery->getGalleryUrl()));
             }
         } else {
             $bGalleryRequirePassword = true;
         }
     }
     # Récupération de la liste des sous-galeries
     $rsSubGalleriesList = $this->okt->galleries->tree->getGalleries(array('active' => 1, 'parent_id' => $rsGallery->id, 'language' => $this->okt->user->language));
     # formatage des données avant affichage
     $this->okt->galleries->tree->prepareGalleries($rsSubGalleriesList);
     # Récupération des éléments de la galerie
     $rsItems = $this->okt->galleries->items->getItems(array('gallery_id' => $rsGallery->id, 'active' => 1, 'language' => $this->okt->user->language));
     # meta description
     if (!empty($rsGallery->meta_description)) {
         $this->okt->page->meta_description = $rsGallery->meta_description;
     } elseif (!empty($this->okt->galleries->config->meta_description[$this->okt->user->language])) {
         $this->okt->page->meta_description = $this->okt->galleries->config->meta_description[$this->okt->user->language];
     } else {
         $this->okt->page->meta_description = util::getSiteMetaDesc();
     }
     # meta keywords
     if (!empty($rsGallery->meta_keywords)) {
         $this->okt->page->meta_description = $rsGallery->meta_keywords;
     } elseif (!empty($this->okt->galleries->config->meta_keywords[$this->okt->user->language])) {
         $this->okt->page->meta_keywords = $this->okt->galleries->config->meta_keywords[$this->okt->user->language];
     } else {
         $this->okt->page->meta_keywords = util::getSiteMetaKeywords();
     }
     # title tag
     $this->okt->page->addTitleTag(!empty($rsGallery->title_tag) ? $rsGallery->title_tag : $rsGallery->title);
     # fil d'ariane
     if (!$this->isDefaultRoute(__CLASS__, __FUNCTION__, $slug)) {
         $this->okt->page->breadcrumb->add($this->okt->galleries->getName(), $this->okt->galleries->config->url);
         $rsPath = $this->okt->galleries->tree->getPath($rsGallery->id, true, $this->okt->user->language);
         while ($rsPath->fetch()) {
             $this->okt->page->breadcrumb->add($rsPath->title, galleriesHelpers::getGalleryUrl($rsPath->slug));
         }
     }
     # titre de la page
     $this->okt->page->setTitle($rsGallery->title);
     # titre SEO de la page
     $this->okt->page->setTitleSeo($rsGallery->title_seo);
     # affichage du template
     echo $this->okt->tpl->render('galleries/gallery/' . $this->okt->galleries->config->templates['gallery']['default'] . '/template', array('bGalleryRequirePassword' => $bGalleryRequirePassword, 'rsGallery' => $rsGallery, 'rsSubGalleries' => $rsSubGalleriesList, 'rsItems' => $rsItems));
 }
开发者ID:jewelhuq,项目名称:okatea,代码行数:83,代码来源:class.galleries.controller.php

示例11: preg_replace

$tb_excerpt = text::cutString(html::escapeHTML($tb_excerpt), 255);
$tb_excerpt = preg_replace('/\\s+/ms', ' ', $tb_excerpt);
# Send pings
if ($post && !$post->isEmpty() && !empty($_POST['tb_urls'])) {
    $tb_urls = $_POST['tb_urls'];
    $tb_urls = str_replace("\r", '', $tb_urls);
    $post_title = html::escapeHTML(trim(html::clean($post_title)));
    foreach (explode("\n", $tb_urls) as $tb_url) {
        try {
            $TB->ping($tb_url, $id, $post_title, $tb_excerpt, $post_url);
        } catch (Exception $e) {
            $core->error->add($e->getMessage());
        }
    }
    if (!$core->error->flag()) {
        http::redirect('trackbacks.php?id=' . $id . '&sent=1');
    }
}
$page_title = __('Ping blogs');
/* DISPLAY
-------------------------------------------------------- */
dcPage::open($page_title, dcPage::jsLoad('js/_trackbacks.js'));
# Exit if we cannot view page
if (!$can_view_page) {
    dcPage::close();
    exit;
}
if (!empty($_GET['sent'])) {
    echo '<p class="message">' . __('All pings sent.') . '</p>';
}
echo '<h2>' . html::escapeHTML($core->blog->name) . ' &rsaquo; ' . $page_title . '</h2>';
开发者ID:HackerMajor,项目名称:root,代码行数:31,代码来源:trackbacks.php

示例12: gui

 public function gui($url)
 {
     $blog =& $this->core->blog;
     $ak_key = $blog->settings->ak_key;
     $ak_verified = null;
     if (isset($_POST['ak_key'])) {
         try {
             $ak_key = $_POST['ak_key'];
             $blog->settings->setNameSpace('akismet');
             $blog->settings->put('ak_key', $ak_key, 'string');
             http::redirect($url . '&up=1');
         } catch (Exception $e) {
             $this->core->error->add($e->getMessage());
         }
     }
     if ($blog->settings->ak_key) {
         try {
             $ak = new akismet($blog->url, $blog->settings->ak_key);
             $ak_verified = $ak->verify();
         } catch (Exception $e) {
             $this->core->error->add($e->getMessage());
         }
     }
     $res = '<form action="' . html::escapeURL($url) . '" method="post">' . '<p><label class="classic">' . __('Akismet API key:') . ' ' . form::field('ak_key', 12, 128, $ak_key) . '</label>';
     if ($ak_verified !== null) {
         if ($ak_verified) {
             $res .= ' <img src="images/check-on.png" alt="" /> ' . __('API key verified');
         } else {
             $res .= ' <img src="images/check-off.png" alt="" /> ' . __('API key not verified');
         }
     }
     $res .= '</p>';
     $res .= '<p><a href="http://wordpress.com/api-keys/">' . __('Get your own API key') . '</a></p>' . '<p><input type="submit" value="' . __('save') . '" />' . $this->core->formNonce() . '</p>' . '</form>';
     return $res;
 }
开发者ID:HackerMajor,项目名称:root,代码行数:35,代码来源:class.dc.filter.akismet.php

示例13: newsItem

 /**
  * Affichage d'un article d'actualités.
  *
  */
 public function newsItem($aMatches)
 {
     # module actuel
     $this->okt->page->module = 'news';
     $this->okt->page->action = 'item';
     # récupération de la page en fonction du slug
     if (!empty($aMatches[0])) {
         $sPostSlug = $aMatches[0];
     } else {
         $this->serve404();
     }
     # récupération de l'article
     $rsPost = $this->okt->news->getPost($sPostSlug, 1);
     if ($rsPost->isEmpty()) {
         $this->serve404();
     }
     # is default route ?
     $bIsDefaultRoute = $this->isDefaultRoute(__CLASS__, __FUNCTION__, $sPostSlug);
     # permission de lecture ?
     if (!$this->okt->news->isPublicAccessible() || !$rsPost->isReadable()) {
         if ($this->okt->user->is_guest) {
             http::redirect(html::escapeHTML(usersHelpers::getLoginUrl($rsPost->url)));
         } else {
             $this->serve404();
         }
     }
     # meta description
     if ($rsPost->meta_description != '') {
         $this->okt->page->meta_description = $rsPost->meta_description;
     } else {
         if ($this->okt->news->config->meta_description[$this->okt->user->language] != '') {
             $this->okt->page->meta_description = $this->okt->news->config->meta_description[$this->okt->user->language];
         } else {
             $this->okt->page->meta_description = util::getSiteMetaDesc();
         }
     }
     # meta keywords
     if ($rsPost->meta_keywords != '') {
         $this->okt->page->meta_keywords = $rsPost->meta_keywords;
     } else {
         if ($this->okt->news->config->meta_keywords[$this->okt->user->language] != '') {
             $this->okt->page->meta_keywords = $this->okt->news->config->meta_keywords[$this->okt->user->language];
         } else {
             $this->okt->page->meta_keywords = util::getSiteMetaKeywords();
         }
     }
     # title tag du module
     $this->okt->page->addTitleTag($this->okt->news->getTitle());
     # début du fil d'ariane
     if (!$bIsDefaultRoute) {
         $this->okt->page->breadcrumb->add($this->okt->news->getName(), $this->okt->news->config->url);
     }
     # si les rubriques sont activées
     if ($this->okt->news->config->categories['enable'] && $rsPost->category_id) {
         # title tag de la rubrique
         $this->okt->page->addTitleTag($rsPost->category_title);
         # ajout de la hiérarchie des rubriques au fil d'ariane
         if (!$bIsDefaultRoute) {
             $rsPath = $this->okt->news->categories->getPath($rsPost->category_id, true, $this->okt->user->language);
             while ($rsPath->fetch()) {
                 $this->okt->page->breadcrumb->add($rsPath->title, newsHelpers::getCategoryUrl($rsPath->slug));
             }
             unset($rsPath);
         }
     }
     # title tag de la page
     $this->okt->page->addTitleTag($rsPost->title_tag == '' ? $rsPost->title : $rsPost->title_tag);
     # titre de la page
     $this->okt->page->setTitle($rsPost->title);
     # titre SEO de la page
     $this->okt->page->setTitleSeo($rsPost->title_seo);
     # fil d'ariane de la page
     if (!$bIsDefaultRoute) {
         $this->okt->page->breadcrumb->add($rsPost->title, $rsPost->url);
     }
     # affichage du template
     echo $this->okt->tpl->render($this->okt->news->getItemTplPath($rsPost->tpl, $rsPost->category_items_tpl), array('rsPost' => $rsPost));
 }
开发者ID:jewelhuq,项目名称:okatea,代码行数:82,代码来源:class.news.controller.php

示例14: array

    $add_email = !empty($_POST['add_email']) ? $_POST['add_email'] : '';
    $add_timezone = !empty($_POST['add_timezone']) ? $_POST['add_timezone'] : '';
    $add_language = !empty($_POST['add_language']) ? $_POST['add_language'] : '';
    # peuplement et vérification des champs personnalisés obligatoires
    if ($okt->users->config->enable_custom_fields) {
        $okt->users->fields->getPostData($rsFields, $aPostedData);
    }
    $add_params = array('civility' => $add_civility, 'active' => $add_active, 'username' => $add_username, 'lastname' => $add_lastname, 'firstname' => $add_firstname, 'password' => $add_password, 'password_confirm' => $add_password_confirm, 'email' => $add_email, 'timezone' => $add_timezone, 'language' => $add_language);
    if ($okt->error->isEmpty() && ($new_id = $okt->users->addUser($add_params)) !== false) {
        if ($okt->users->config->enable_custom_fields) {
            while ($rsFields->fetch()) {
                $okt->users->fields->setUserValues($new_id, $rsFields->id, $aPostedData[$rsFields->id]);
            }
        }
        $okt->page->flashMessages->addSuccess(__('m_users_user_added'));
        http::redirect('module.php?m=users&action=edit&id=' . $new_id);
    }
}
/* Affichage
----------------------------------------------------------*/
# Langues
$rs = $okt->languages->getLanguages();
$aLanguages = array();
while ($rs->fetch()) {
    $aLanguages[html::escapeHTML($rs->title)] = $rs->code;
}
# Civilités
$aCivilities = array_merge(array('&nbsp;' => 0), module_users::getCivilities(true));
# Titre de la page
$okt->page->addGlobalTitle(__('c_c_action_Add'));
# Validation javascript
开发者ID:jewelhuq,项目名称:okatea,代码行数:31,代码来源:add.php

示例15: superadmin

        $db->query($query);
        # insertion superadmin (id 2)
        $query = 'INSERT INTO `' . OKT_DB_PREFIX . 'core_users` (' . '`id`, `username`, `group_id`, `salt`, `password`, `language`, `timezone`, `email`, `registered`, `last_visit`' . ') VALUES ( ' . '2, ' . '\'' . $db->escapeStr($sudo_user) . '\', ' . '1, ' . '\'' . $db->escapeStr(util::random_key(12)) . '\', ' . '\'' . $db->escapeStr(password::hash($sudo_password, PASSWORD_DEFAULT)) . '\', ' . '\'fr\', ' . '\'Europe/Paris\', ' . '\'' . $db->escapeStr($sudo_email) . '\', ' . $current_timestamp . ', ' . $current_timestamp . ' ' . ');';
        $db->query($query);
        # insertion admin id 3
        $query = 'INSERT INTO `' . OKT_DB_PREFIX . 'core_users` (' . '`id`, `username`, `group_id`, `salt`, `password`, `language`, `timezone`, `email`, `registered`, `last_visit`' . ') VALUES ( ' . '3, ' . '\'' . $db->escapeStr($admin_user) . '\', ' . '2, ' . '\'' . $db->escapeStr(util::random_key(12)) . '\', ' . '\'' . $db->escapeStr(password::hash($admin_password, PASSWORD_DEFAULT)) . '\', ' . '\'fr\', ' . '\'Europe/Paris\', ' . '\'' . $db->escapeStr($admin_email) . '\', ' . $current_timestamp . ', ' . $current_timestamp . ' ' . ');';
        $db->query($query);
        $_SESSION['okt_install_sudo_user'] = $sudo_user;
        $_SESSION['okt_install_sudo_password'] = $sudo_password;
        $_SESSION['okt_install_admin_user'] = $admin_user;
        $_SESSION['okt_install_admin_password'] = $admin_password;
        # Inclusion du prepend
        require_once __DIR__ . '/../../../oktInc/prepend.php';
        # login
        $okt->user->login($sudo_user, $sudo_password, 1);
        http::redirect('index.php?step=' . $stepper->getNextStep());
    }
}
/* Affichage
------------------------------------------------------------*/
# En-tête
$title = __('i_supa_title');
require OKT_INSTAL_DIR . '/header.php';
?>

<form action="index.php" method="post">

	<div class="two-cols">
		<div class="col">
			<h3><?php 
_e('i_supa_account_sudo');
开发者ID:jewelhuq,项目名称:okatea,代码行数:31,代码来源:supa.php


注:本文中的http::redirect方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。