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


PHP util::getSiteTitle方法代码示例

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


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

示例1:

<?php

echo '<?xml version="1.0" encoding="utf-8"?>';
?>
<rss version="2.0"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><?php 
echo html::escapeHTML(util::getSiteTitle() . ' - ' . $okt->news->getTitle());
?>
</title>
		<link><?php 
echo html::escapeHTML($okt->config->app_host . $okt->news->config->url);
?>
</link>
		<atom:link href="<?php 
echo html::escapeHTML($okt->config->app_host . $okt->news->config->feed_url);
?>
" rel="self" type="application/rss+xml"/>
		<description><?php 
echo html::escapeHTML(util::getSiteDescription());
?>
</description>
		<language><?php 
echo html::escapeHTML($okt->config->language);
?>
</language>
		<!-- <pubDate>{{tpl:BlogUpdateDate rfc822="1"}}</pubDate> -->
开发者ID:jewelhuq,项目名称:okatea,代码行数:31,代码来源:template.php

示例2: __

}
# Permissions de base de l'administration
$okt->addPerm('usage', __('c_a_def_perm_usage'));
$okt->addPerm('displayhelp', __('c_a_def_perm_help'));
$okt->addPermGroup('configuration', __('c_a_def_perm_config'));
$okt->addPerm('configsite', __('c_a_def_perm_config_website'), 'configuration');
$okt->addPerm('display', __('c_a_def_perm_config_display'), 'configuration');
$okt->addPerm('languages', __('c_a_def_perm_config_local'), 'configuration');
$okt->addPerm('modules', __('c_a_def_perm_config_modules'), 'configuration');
$okt->addPerm('themes', __('c_a_def_perm_config_themes'), 'configuration');
$okt->addPerm('navigation', __('c_a_def_perm_config_navigation'), 'configuration');
$okt->addPerm('permissions', __('c_a_def_perm_config_perms'), 'configuration');
$okt->addPerm('tools', __('c_a_def_perm_config_tools'), 'configuration');
$okt->addPerm('infos', __('c_a_def_perm_config_infos'), 'configuration');
# Title tag
$okt->page->addTitleTag(util::getSiteTitleTag(null, util::getSiteTitle()));
# Fil d'ariane administration
$okt->page->addAriane(__('Administration'), 'index.php');
# Initialisation menu principal et ses sous-menus
if (!defined('OKT_DISABLE_MENU')) {
    # Menu principal
    $okt->page->mainMenu = new htmlBlockList('mainMenu-' . ($okt->config->admin_sidebar_position == 0 ? 'left' : 'right'), adminPage::$formatHtmlMainMenu);
    # Accueil
    $okt->page->mainMenu->add(__('c_a_menu_home'), 'index.php', OKT_FILENAME == 'index.php', 1, true, null, $okt->page->homeSubMenu = new htmlBlockList(null, adminPage::$formatHtmlSubMenu), OKT_PUBLIC_URL . '/img/admin/start-here.png');
    $okt->page->homeSubMenu->add(__('c_a_menu_roundabout'), 'index.php', OKT_FILENAME == 'index.php', 10, true);
    # Configuration
    $okt->page->mainMenu->add(__('c_a_menu_configuration'), 'configuration.php', OKT_FILENAME == 'configuration.php', 10000000, $okt->checkPerm('configsite'), null, $okt->page->configSubMenu = new htmlBlockList(null, adminPage::$formatHtmlSubMenu), OKT_PUBLIC_URL . '/img/admin/network-server.png');
    $okt->page->configSubMenu->add(__('c_a_menu_general'), 'configuration.php?action=site', OKT_FILENAME == 'configuration.php' && (!$okt->page->action || $okt->page->action === 'site'), 10, $okt->checkPerm('configsite'));
    $okt->page->configSubMenu->add(__('c_a_menu_display'), 'configuration.php?action=display', OKT_FILENAME == 'configuration.php' && $okt->page->action === 'display', 20, $okt->checkPerm('display'));
    $okt->page->configSubMenu->add(__('c_a_menu_localization'), 'configuration.php?action=languages', OKT_FILENAME == 'configuration.php' && $okt->page->action === 'languages', 60, $okt->checkPerm('languages'));
    $okt->page->configSubMenu->add(__('c_a_menu_modules'), 'configuration.php?action=modules', OKT_FILENAME == 'configuration.php' && $okt->page->action === 'modules', 70, $okt->checkPerm('modules'));
开发者ID:jewelhuq,项目名称:okatea,代码行数:31,代码来源:prepend.php

示例3: setBodyFromPostedData

 /**
  * Définit le corps du mail en fonction des données saisies dans le formulaire.
  *
  * @return void
  */
 public function setBodyFromPostedData()
 {
     $this->sBody = 'Contact depuis le site internet ' . html::escapeHTML(util::getSiteTitle()) . ' [' . $this->okt->config->app_url . ']' . PHP_EOL . PHP_EOL;
     $sSenderName = $this->getSenderName();
     if (!empty($sSenderName)) {
         $this->sBody .= 'Nom : ' . $sSenderName . PHP_EOL;
     }
     $this->sBody .= 'E-mail : ' . $this->aPostedData[4] . PHP_EOL;
     if (!empty($this->aPostedData[5])) {
         $this->sBody .= 'Téléphone : ' . $this->aPostedData[5] . PHP_EOL;
     }
     $this->sBody .= PHP_EOL . 'Sujet : ' . $this->getSubject() . PHP_EOL;
     $this->sBody .= 'Message : ' . PHP_EOL . PHP_EOL;
     $this->sBody .= $this->aPostedData[7] . PHP_EOL . PHP_EOL;
     # ajout des autres champs
     while ($this->rsFields->fetch()) {
         if ($this->isDefaultField($this->rsFields->id)) {
             continue;
         }
         if (!empty($this->aPostedData[$this->rsFields->id])) {
             $sFieldValue = null;
             switch ($this->rsFields->type) {
                 default:
                 case 1:
                     # Champ texte
                 # Champ texte
                 case 2:
                     # Zone de texte
                     $sFieldValue = $this->aPostedData[$this->rsFields->id];
                     break;
                 case 3:
                     # Menu déroulant
                 # Menu déroulant
                 case 4:
                     # Boutons radio
                 # Boutons radio
                 case 5:
                     # Cases à cocher
                     $aValues = array_filter((array) unserialize($this->rsFields->value));
                     if (is_array($this->aPostedData[$this->rsFields->id])) {
                         $aFieldValue = array();
                         foreach ($this->aPostedData[$this->rsFields->id] as $value) {
                             if (isset($aValues[$value])) {
                                 $aFieldValue[] = $aValues[$value];
                             }
                         }
                         $sFieldValue = implode(', ', $aFieldValue);
                     } else {
                         $sFieldValue = isset($aValues[$this->aPostedData[$this->rsFields->id]]) ? $aValues[$this->aPostedData[$this->rsFields->id]] : '';
                     }
                     break;
             }
             $this->sBody .= html::escapeHtml($this->rsFields->title) . ' : ' . html::escapeHtml($sFieldValue) . PHP_EOL;
         }
     }
 }
开发者ID:jewelhuq,项目名称:okatea,代码行数:61,代码来源:module_handler.php

示例4: array

# -- CORE TRIGGER : publicModuleGuestbookControllerStart
$okt->triggers->callTrigger('publicModuleGuestbookControllerStart', $okt, $okt->guestbook->config->captcha);
$aSigData = array('language' => $okt->user->language, 'message' => '', 'nom' => '', 'email' => '', 'url' => 'http://', 'note' => 'nc');
# formulaire envoyé
if (!empty($_POST['sign'])) {
    $aSigData = array('language' => isset($_POST['language']) ? $_POST['language'] : $okt->user->language, 'message' => isset($_POST['msg']) ? $_POST['msg'] : null, 'nom' => isset($_POST['nom']) ? $_POST['nom'] : null, 'email' => isset($_POST['email']) ? $_POST['email'] : null, 'url' => isset($_POST['url']) ? $_POST['url'] : 'http://', 'note' => isset($_POST['note']) ? $_POST['note'] : null, 'ip' => http::realIP(), 'visible' => $okt->guestbook->config->validation ? 0 : 1);
    $aSigData = $okt->guestbook->handleUserData($aSigData);
    # -- CORE TRIGGER : publicModuleGuestbookControllerFormCheckValues
    $okt->triggers->callTrigger('publicModuleGuestbookControllerFormCheckValues', $okt);
    if (!$okt->error->hasError()) {
        if ($okt->guestbook->addSig($aSigData)) {
            if ($okt->guestbook->config->emails_list != '') {
                $oMail = new oktMail($okt);
                $oMail->setFrom();
                $oMail->message->setSubject('Nouveau message sur le livre d’or de ' . util::getSiteTitle());
                $mail_body = 'Bonjour,' . "\n\n" . 'Un utilisateur a laissé un nouveau message ' . 'sur le livre d’or de "' . util::getSiteTitle() . '".' . "\n\n";
                if ($okt->guestbook->config->validation) {
                    $mail_body .= 'Ce nouveau message peut être validé ' . 'en vous rendant sur l’administration.' . "\n\n";
                }
                $mail_body .= 'Cordialement' . PHP_EOL . PHP_EOL . '--' . PHP_EOL . 'Email automatique,' . PHP_EOL . 'ne repondez pas à ce message';
                $oMail->message->setBody($mail_body);
                $dests = array_map('trim', explode(',', $okt->guestbook->config->emails_list));
                $oMail->message->setTo($dests);
                $oMail->send();
            }
            http::redirect($okt->guestbook->config->url . '?added=1');
        }
    }
}
# signatures à afficher
$aGuestbookParams = array('is_not_spam' => true, 'is_visible' => true, 'language' => $okt->user->language);
开发者ID:jewelhuq,项目名称:okatea,代码行数:31,代码来源:list.php

示例5: _e

<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title><?php 
_e('c_c_Email');
?>
 - <?php 
echo html::escapeHTML(util::getSiteTitle());
?>
</title>
		<style type="text/css">
			body, div, p { margin: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-style: normal; color: #000000; }
			a, a:link, a:active, a:visited, a:focus, a:hover { font-weight: normal; color: #333333; }

			.page { width: 700px; display:block; margin: auto; }
			.contenu { padding: 15px; }
		</style>
	</head>
	<body>
		<div class="page">
			<img src="http://<?php 
echo html::escapeHTML($okt->config->domain) . OKT_THEME;
?>
/images/mail/mail_header.jpg" />
		</div>
		<div class="page">
			<div class="contenu">
				<?php 
echo $body;
?>
			</div>
		</div>
开发者ID:jewelhuq,项目名称:okatea,代码行数:31,代码来源:layout_mail.php

示例6: estimateSummary

 /**
  * Affichage de la page de récapitulatif de demande de devis.
  *
  */
 public function estimateSummary()
 {
     # module actuel
     $this->okt->page->module = 'estimate';
     $this->okt->page->action = 'summary';
     # si on as pas de données en session on renvoi sur le formulaire
     if (empty($_SESSION['okt_mod_estimate_form_data'])) {
         http::redirect($this->okt->page->getBaseUrl() . $this->okt->estimate->config->public_form_url[$this->okt->user->language]);
     }
     # récupération des produits et des accessoires
     $rsProducts = $this->okt->estimate->products->getProducts();
     $aProducts = array();
     $aProductsAccessories = array();
     while ($rsProducts->fetch()) {
         $aProducts[$rsProducts->id] = html::escapeHTML($rsProducts->title);
         if ($this->okt->estimate->config->enable_accessories) {
             $rsAccessories = $this->okt->estimate->accessories->getAccessories(array('product_id' => $rsProducts->id));
             if (!$rsAccessories->isEmpty()) {
                 $aProductsAccessories[$rsProducts->id] = array();
                 while ($rsAccessories->fetch()) {
                     $aProductsAccessories[$rsProducts->id][$rsAccessories->id] = html::escapeHTML($rsAccessories->title);
                 }
             }
             unset($rsAccessories);
         }
     }
     unset($rsProducts);
     # formatage des données
     $aFormatedData = $_SESSION['okt_mod_estimate_form_data'];
     unset($aFormatedData['products'], $aFormatedData['product_quantity'], $aFormatedData['accessories'], $aFormatedData['accessory_quantity']);
     foreach ($_SESSION['okt_mod_estimate_form_data']['products'] as $iProductCounter => $iProductId) {
         $aFormatedData['products'][$iProductCounter] = array('title' => $aProducts[$iProductId], 'quantity' => $_SESSION['okt_mod_estimate_form_data']['product_quantity'][$iProductCounter], 'accessories' => array());
         if (!empty($_SESSION['okt_mod_estimate_form_data']['accessories'][$iProductCounter])) {
             foreach ($_SESSION['okt_mod_estimate_form_data']['accessories'][$iProductCounter] as $iAccessoryCounter => $iAccessoryId) {
                 $aFormatedData['products'][$iProductCounter]['accessories'][$iAccessoryCounter] = array('title' => $aProductsAccessories[$iProductId][$iAccessoryId], 'quantity' => $_SESSION['okt_mod_estimate_form_data']['accessory_quantity'][$iProductCounter][$iAccessoryCounter]);
             }
         }
     }
     # enregistrement de la demande
     if (!empty($_GET['send'])) {
         if (($iEstimateId = $this->okt->estimate->addEstimate($aFormatedData)) !== false) {
             unset($_SESSION['okt_mod_estimate_form_data']);
             # notifications
             if ($this->okt->estimate->config->enable_notifications) {
                 $aRecipients = array();
                 if (!empty($this->okt->estimate->config->notifications_recipients)) {
                     $aRecipients = array_map('trim', explode(',', $this->okt->estimate->config->notifications_recipients));
                 }
                 if (empty($aRecipients)) {
                     if (!empty($this->config->email['name'])) {
                         $aRecipients = array($this->okt->config->email['to'] => html::escapeHTML($this->config->email['name']));
                     } else {
                         $aRecipients = array($this->okt->config->email['to']);
                     }
                 }
                 # construction du mail
                 $sEstimateUrl = $this->okt->config->app_host . $this->okt->config->app_path . OKT_ADMIN_DIR . '/module.php?m=estimate&action=estimate&estimate_id=' . $iEstimateId;
                 $oMail = new oktMail($this->okt);
                 $oMail->setFrom();
                 $oMail->message->setTo($aRecipients);
                 $oMail->useFile(dirname(__FILE__) . '/../locales/' . $this->okt->user->language . '/mails_tpl/admin_notification.tpl', array('SITE_TITLE' => html::escapeHTML(util::getSiteTitle()), 'USER_FIRSTNAME' => $aFormatedData['firstname'], 'USER_LASTNAME' => $aFormatedData['lastname'], 'ADMIN_ESTIMATE_URL' => html::escapeHTML($sEstimateUrl)));
                 $oMail->send();
             }
             http::redirect($this->okt->page->getBaseUrl() . $this->okt->estimate->config->public_form_url[$this->okt->user->language] . '?added=1');
         }
     }
     # meta description
     if ($this->okt->estimate->config->meta_description[$this->okt->user->language] != '') {
         $this->okt->page->meta_description = $this->okt->estimate->config->meta_description[$this->okt->user->language];
     } else {
         $this->okt->page->meta_description = util::getSiteMetaDesc();
     }
     # meta keywords
     if ($this->okt->estimate->config->meta_keywords[$this->okt->user->language] != '') {
         $this->okt->page->meta_keywords = $this->okt->estimate->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->estimate->getTitle());
     # fil d'ariane
     if (!$this->isDefaultRoute(__CLASS__, __FUNCTION__)) {
         $this->okt->page->breadcrumb->add($this->okt->estimate->getName(), $this->okt->estimate->config->url);
     }
     # titre de la page
     $this->okt->page->setTitle($this->okt->estimate->getName());
     # titre SEO de la page
     $this->okt->page->setTitleSeo($this->okt->estimate->getNameSeo());
     # affichage du template
     echo $this->okt->tpl->render('estimate/summary/' . $this->okt->estimate->config->templates['summary']['default'] . '/template', array('aEstimateData' => $aFormatedData));
 }
开发者ID:jewelhuq,项目名称:okatea,代码行数:95,代码来源:class.estimate.controller.php

示例7: performRegister

 /**
  * Réalise une inscription.
  *
  */
 protected function performRegister()
 {
     # default data
     $this->aUserRegisterData = array('civility' => 1, 'username' => '', 'lastname' => '', 'firstname' => '', 'password' => '', 'password_confirm' => '', 'email' => '', 'group_id' => $this->okt->users->config->default_group, 'timezone' => $this->okt->config->timezone, 'language' => $this->okt->config->language);
     # Champs personnalisés
     if ($this->okt->users->config->enable_custom_fields) {
         $aPostedData = array();
         # Liste des champs
         $this->rsUserFields = $this->okt->users->fields->getFields(array('status' => true, 'user_editable' => true, 'register' => true, 'language' => $this->okt->user->language));
         # Valeurs des champs
         $rsFieldsValues = $this->okt->users->fields->getUserValues($this->okt->user->id);
         $aFieldsValues = array();
         while ($rsFieldsValues->fetch()) {
             $aFieldsValues[$rsFieldsValues->field_id] = $rsFieldsValues->value;
         }
         # Initialisation des données des champs
         while ($this->rsUserFields->fetch()) {
             switch ($this->rsUserFields->type) {
                 default:
                 case 1:
                     # Champ texte
                 # Champ texte
                 case 2:
                     # Zone de texte
                     $aPostedData[$this->rsUserFields->id] = !empty($_POST[$this->rsUserFields->html_id]) ? $_POST[$this->rsUserFields->html_id] : (!empty($aFieldsValues[$this->rsUserFields->id]) ? $aFieldsValues[$this->rsUserFields->id] : '');
                     break;
                 case 3:
                     # Menu déroulant
                     $aPostedData[$this->rsUserFields->id] = isset($_POST[$this->rsUserFields->html_id]) ? $_POST[$this->rsUserFields->html_id] : (!empty($aFieldsValues[$this->rsUserFields->id]) ? $aFieldsValues[$this->rsUserFields->id] : '');
                     break;
                 case 4:
                     # Boutons radio
                     $aPostedData[$this->rsUserFields->id] = isset($_POST[$this->rsUserFields->html_id]) ? $_POST[$this->rsUserFields->html_id] : (!empty($aFieldsValues[$this->rsUserFields->id]) ? $aFieldsValues[$this->rsUserFields->id] : '');
                     break;
                 case 5:
                     # Cases à cocher
                     $aPostedData[$this->rsUserFields->id] = !empty($_POST[$this->rsUserFields->html_id]) && is_array($_POST[$this->rsUserFields->html_id]) ? $_POST[$this->rsUserFields->html_id] : (!empty($aFieldsValues[$this->rsUserFields->id]) ? $aFieldsValues[$this->rsUserFields->id] : '');
                     break;
             }
         }
     }
     # ajout d'un utilisateur
     if (!empty($_POST['add_user'])) {
         $this->aUserRegisterData = array('active' => 1, 'username' => !empty($_POST['add_username']) ? $_POST['add_username'] : '', 'lastname' => !empty($_POST['add_lastname']) ? $_POST['add_lastname'] : '', 'firstname' => !empty($_POST['add_firstname']) ? $_POST['add_firstname'] : '', 'password' => !empty($_POST['add_password']) ? $_POST['add_password'] : '', 'password_confirm' => !empty($_POST['add_password_confirm']) ? $_POST['add_password_confirm'] : '', 'email' => !empty($_POST['add_email']) ? $_POST['add_email'] : '', 'group_id' => $this->okt->users->config->user_choose_group && !empty($_POST['add_group_id']) && in_array($_POST['add_group_id'], $this->getGroups()) ? $_POST['add_group_id'] : $this->okt->users->config->default_group, 'timezone' => !empty($_POST['add_timezone']) ? $_POST['add_timezone'] : $this->okt->config->timezone, 'language' => !empty($_POST['add_language']) && in_array($_POST['add_language'], $this->getLanguages()) ? $_POST['add_language'] : $this->okt->config->language, 'civility' => !empty($_POST['add_civility']) ? $_POST['add_civility'] : '');
         if ($this->okt->users->config->merge_username_email) {
             $this->aUserRegisterData['username'] = $this->aUserRegisterData['email'];
         }
         # vérification des champs personnalisés obligatoires
         if ($this->okt->users->config->enable_custom_fields) {
             while ($this->rsUserFields->fetch()) {
                 if ($this->rsUserFields->active == 2 && empty($aPostedData[$this->rsUserFields->id])) {
                     $this->okt->error->set('Vous devez renseigner le champ "' . html::escapeHtml($this->rsUserFields->title) . '".');
                 }
             }
         }
         if (($new_id = $this->okt->users->addUser($this->aUserRegisterData)) !== false) {
             $_POST['user_id'] = $new_id;
             # -- CORE TRIGGER : adminModUsersRegisterProcess
             $this->okt->triggers->callTrigger('adminModUsersRegisterProcess', $this->okt, $_POST);
             $rsUser = $this->okt->users->getUser($new_id);
             if ($this->okt->users->config->enable_custom_fields) {
                 while ($this->rsUserFields->fetch()) {
                     $this->okt->users->fields->setUserValues($new_id, $this->rsUserFields->id, $aPostedData[$this->rsUserFields->id]);
                 }
             }
             # Initialisation du mailer et envoi du mail
             $oMail = new oktMail($this->okt);
             $oMail->setFrom();
             if ($this->okt->users->config->validate_users_registration) {
                 $template_file = 'welcom_waiting.tpl';
             } else {
                 $template_file = 'welcom.tpl';
             }
             $oMail->useFile(__DIR__ . '/../locales/' . $rsUser->language . '/templates/' . $template_file, array('SITE_TITLE' => util::getSiteTitle($rsUser->language), 'SITE_URL' => $this->okt->config->app_url, 'USER_CN' => oktAuth::getUserCN($rsUser->username, $rsUser->lastname, $rsUser->firstname), 'USERNAME' => $rsUser->username, 'PASSWORD' => $this->aUserRegisterData['password']));
             $oMail->message->setTo($rsUser->email);
             $oMail->send();
             # Initialisation du mailer et envoi du mail à l'administrateur
             if ($this->okt->users->config->mail_new_registration) {
                 $oMail = new oktMail($this->okt);
                 $oMail->setFrom();
                 if ($this->okt->users->config->validate_users_registration) {
                     $template_file = 'registration_validate.tpl';
                 } else {
                     $template_file = 'registration.tpl';
                 }
                 $rsAdministrators = $this->okt->users->getUsers(array('group_id' => oktAuth::admin_group_id));
                 while ($rsAdministrators->fetch()) {
                     $oMail->useFile(__DIR__ . '/../locales/' . $rsAdministrators->language . '/templates/' . $template_file, array('SITE_TITLE' => util::getSiteTitle($rsUser->language), 'SITE_URL' => $this->okt->config->app_url, 'USER_CN' => oktAuth::getUserCN($rsUser->username, $rsUser->lastname, $rsUser->firstname), 'PROFIL' => $this->okt->config->app_url . OKT_ADMIN_DIR . '/module.php?m=users&action=edit&id=' . $rsUser->id));
                     $oMail->message->setTo($rsAdministrators->email);
                     $oMail->send();
                 }
             }
             # eventuel connexion du nouvel utilisateur
             if (!$this->okt->users->config->validate_users_registration && $this->okt->users->config->auto_log_after_registration) {
                 $this->okt->user->login($this->aUserRegisterData['username'], $this->aUserRegisterData['password'], false);
             }
//.........这里部分代码省略.........
开发者ID:jewelhuq,项目名称:okatea,代码行数:101,代码来源:class.users.controller.php

示例8: array

        $oMail->message->setTo($edit_email);
        $oMail->send();
        $okt->page->flashMessages->addSuccess(__('m_users_validated_user'));
        $okt->redirect('module.php?m=users&action=edit&id=' . $aEditPageInfos['iUserId']);
    }
}
# Formulaire de changement de mot de passe
if (!empty($_POST['change_password']) && $okt->checkPerm('change_password') && $okt->checkPerm('users_edit')) {
    $upd_params = array('id' => $aEditPageInfos['iUserId']);
    $upd_params['password'] = !empty($_POST['edit_password']) ? $_POST['edit_password'] : '';
    $upd_params['password_confirm'] = !empty($_POST['edit_password_confirm']) ? $_POST['edit_password_confirm'] : '';
    if ($okt->users->changeUserPassword($upd_params)) {
        if (!empty($_POST['send_password_mail'])) {
            $oMail = new oktMail($okt);
            $oMail->setFrom();
            $oMail->useFile(__DIR__ . '/../../locales/' . $edit_language . '/templates/admin_change_user_password.tpl', array('SITE_TITLE' => util::getSiteTitle($edit_language), 'SITE_URL' => $okt->config->app_url, 'NEW_PASSWORD' => $upd_params['password']));
            $oMail->message->setTo($edit_email);
            $oMail->send();
        }
        $okt->page->flashMessages->addSuccess(__('m_users_user_edited'));
        $okt->redirect('module.php?m=users&action=edit&id=' . $aEditPageInfos['iUserId']);
    }
}
# Formulaire de modification de l'utilisateur envoyé
if (!empty($_POST['form_sent']) && !isset($_POST['do']) && $okt->checkPerm('users_edit')) {
    $upd_params = array('id' => $aEditPageInfos['iUserId']);
    if (isset($_POST['edit_civility'])) {
        $upd_params['civility'] = $_POST['edit_civility'];
    }
    if (isset($_POST['edit_active'])) {
        $upd_params['active'] = $_POST['edit_active'];
开发者ID:jewelhuq,项目名称:okatea,代码行数:31,代码来源:edit.php

示例9: forgetPassword

 /**
  * Envoi un email avec un nouveau mot de passe.
  *
  * @param string $sEmail    		L'adresse email où envoyer le nouveau mot de passe
  * @param string $sActivateUrl		L'URL de la page de validation
  * @return boolean
  */
 public function forgetPassword($sEmail, $sActivateUrl)
 {
     $sEmail = strtolower(trim($sEmail));
     # validation de l'adresse fournie
     if (!text::isEmail($sEmail)) {
         $this->oError->set(__('c_c_auth_invalid_email'));
         return false;
     }
     # récupération des infos de l'utilisateur
     $sQuery = 'SELECT id, username, lastname, firstname, salt ' . 'FROM ' . $this->t_users . ' ' . 'WHERE email=\'' . $this->oDb->escapeStr($sEmail) . '\'';
     if (($rs = $this->oDb->select($sQuery)) === false) {
         return false;
     }
     if ($rs->isEmpty()) {
         $this->oError->set(__('c_c_auth_unknown_email'));
         return false;
     }
     while ($rs->fetch()) {
         # génération du nouveau mot de passe et du code d'activation
         $sNewPassword = util::random_key(8, true);
         $sNewPasswordKey = util::random_key(8);
         $sPasswordHash = password::hash($sNewPassword, PASSWORD_DEFAULT);
         $sQuery = 'UPDATE ' . $this->t_users . ' SET ' . 'activate_string=\'' . $sPasswordHash . '\', ' . 'activate_key=\'' . $sNewPasswordKey . '\' ' . 'WHERE id=' . (int) $rs->id;
         if (!$this->oDb->execute($sQuery)) {
             return false;
         }
         # Initialisation du mailer et envoi du mail
         $oMail = new oktMail($this->okt);
         $oMail->setFrom();
         $oMail->message->setTo($sEmail);
         $oMail->useFile(OKT_LOCALES_PATH . '/' . $this->okt->user->language . '/templates/activate_password.tpl', array('SITE_TITLE' => util::getSiteTitle(), 'SITE_URL' => $this->okt->config->app_url, 'USERNAME' => self::getUserCN($rs->username, $rs->lastname, $rs->firstname), 'NEW_PASSWORD' => $sNewPassword, 'ACTIVATION_URL' => $sActivateUrl . '?action=validate_password&uid=' . $rs->id . '&key=' . rawurlencode($sNewPasswordKey)));
         $oMail->send();
     }
     return true;
 }
开发者ID:jewelhuq,项目名称:okatea,代码行数:42,代码来源:class.oktAuth.php

示例10: guestbookPage

 /**
  * Affichage de la page guestbook.
  *
  */
 public function guestbookPage()
 {
     # module actuel
     $this->okt->page->module = 'guestbook';
     $this->okt->page->action = 'list';
     # -- CORE TRIGGER : publicModuleGuestbookControllerStart
     $this->okt->triggers->callTrigger('publicModuleGuestbookControllerStart', $this->okt, $this->okt->guestbook->config->captcha);
     $aSigData = array('language' => $this->okt->user->language, 'message' => '', 'nom' => '', 'email' => '', 'url' => 'http://', 'note' => 'nc');
     # formulaire envoyé
     if (!empty($_POST['sign'])) {
         $aSigData = array('language' => isset($_POST['language']) ? $_POST['language'] : $this->okt->user->language, 'message' => isset($_POST['msg']) ? $_POST['msg'] : null, 'nom' => isset($_POST['nom']) ? $_POST['nom'] : null, 'email' => isset($_POST['email']) ? $_POST['email'] : null, 'url' => isset($_POST['url']) ? $_POST['url'] : 'http://', 'note' => isset($_POST['note']) ? $_POST['note'] : null, 'ip' => http::realIP(), 'visible' => $this->okt->guestbook->config->validation ? 0 : 1);
         $aSigData = $this->okt->guestbook->handleUserData($aSigData);
         # -- CORE TRIGGER : publicModuleGuestbookControllerFormCheckValues
         $this->okt->triggers->callTrigger('publicModuleGuestbookControllerFormCheckValues', $this->okt, $this->okt->guestbook->config->captcha);
         if (!$this->okt->error->hasError()) {
             if ($this->okt->guestbook->addSig($aSigData)) {
                 if ($this->okt->guestbook->config->emails_list != '') {
                     $oMail = new oktMail($this->okt);
                     $oMail->setFrom();
                     $oMail->message->setSubject('Nouveau message sur le livre d’or de ' . util::getSiteTitle());
                     $mail_body = 'Bonjour,' . "\n\n" . 'Un utilisateur a laissé un nouveau message ' . 'sur le livre d’or de "' . util::getSiteTitle() . '".' . "\n\n";
                     if ($this->okt->guestbook->config->validation) {
                         $mail_body .= 'Ce nouveau message peut être validé ' . 'en vous rendant sur l’administration.' . "\n\n";
                     }
                     $mail_body .= 'Cordialement' . PHP_EOL . PHP_EOL . '--' . PHP_EOL . 'Email automatique,' . PHP_EOL . 'ne repondez pas à ce message';
                     $oMail->message->setBody($mail_body);
                     $dests = array_map('trim', explode(',', $this->okt->guestbook->config->emails_list));
                     $oMail->message->setTo($dests);
                     $oMail->send();
                 }
                 http::redirect($this->okt->guestbook->config->url . '?added=1');
             }
         }
     }
     # signatures à afficher
     $aGuestbookParams = array('is_not_spam' => true, 'is_visible' => true, 'language' => $this->okt->user->language);
     # initialisation de la pagination
     $iPage = !empty($_GET['page']) ? intval($_GET['page']) : 1;
     $oGuestbookPager = new publicPager($iPage, $this->okt->guestbook->getSig($aGuestbookParams, true), $this->okt->guestbook->config->nbparpage_public);
     $iNumPages = $oGuestbookPager->getNbPages();
     # récupération des signatures
     $aGuestbookParams['limit'] = ($iPage - 1) * $this->okt->guestbook->config->nbparpage_public . ',' . $this->okt->guestbook->config->nbparpage_public;
     $signaturesList = $this->okt->guestbook->getSig($aGuestbookParams);
     $aLanguages = array();
     foreach ($this->okt->languages->list as $aLanguage) {
         if (isset($this->okt->guestbook->config->public_url[$aLanguage['code']])) {
             $aLanguages[$aLanguage['title']] = $aLanguage['code'];
         }
     }
     # formatage des données
     $num_sig = 0;
     while ($signaturesList->fetch()) {
         $signaturesList->number = ++$num_sig;
         # note
         if ($this->okt->guestbook->config->chp_note) {
             if (!is_numeric($signaturesList->note)) {
                 $signaturesList->note = 'nc';
             } else {
                 $signaturesList->note = ceil($signaturesList->note) . '/20';
             }
         } else {
             $signaturesList->note = null;
         }
     }
     # meta description
     if ($this->okt->guestbook->config->meta_description[$this->okt->user->language] != '') {
         $this->okt->page->meta_description = $this->okt->guestbook->config->meta_description[$this->okt->user->language];
     } else {
         $this->okt->page->meta_description = util::getSiteMetaDesc();
     }
     # meta keywords
     if ($this->okt->guestbook->config->meta_keywords[$this->okt->user->language] != '') {
         $this->okt->page->meta_keywords = $this->okt->guestbook->config->meta_keywords[$this->okt->user->language];
     } else {
         $this->okt->page->meta_keywords = util::getSiteMetaKeywords();
     }
     # ajout du numéro de page au title
     if ($iPage > 1) {
         $this->okt->page->addTitleTag(sprintf(__('c_c_Page_%s'), $iPage));
     }
     # title tag
     $this->okt->page->addTitleTag($this->okt->guestbook->getTitle());
     # titre de la page
     $this->okt->page->setTitle($this->okt->guestbook->getName());
     # titre SEO de la page
     $this->okt->page->setTitleSeo($this->okt->guestbook->getNameSeo());
     # fil d'ariane de la page
     if (!$this->isDefaultRoute(__CLASS__, __FUNCTION__)) {
         $this->okt->page->breadcrumb->add($this->okt->guestbook->getName(), $this->okt->guestbook->config->url);
     }
     # raccourcis
     $signaturesList->numPages = $iNumPages;
     $signaturesList->pager = $oGuestbookPager;
     # affichage du template
     echo $this->okt->tpl->render('guestbook_tpl', array('aSigData' => $aSigData, 'signaturesList' => $signaturesList, 'aLanguages' => $aLanguages));
 }
开发者ID:jewelhuq,项目名称:okatea,代码行数:100,代码来源:class.guestbook.controller.php


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