• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP flash_success函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中flash_success函数的典型用法代码示例。如果您正苦于以下问题:PHP flash_success函数的具体用法?PHP flash_success怎么用?PHP flash_success使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: update_category

 /**
  * Show and process config category form
  *
  * @param void
  * @return null
  */
 function update_category()
 {
     $category = ConfigCategories::findById(get_id());
     if (!$category instanceof ConfigCategory) {
         flash_error(lang('config category dnx'));
         $this->redirectToReferer(get_url('administration'));
     }
     // if
     if ($category->isEmpty()) {
         flash_error(lang('config category is empty'));
         $this->redirectToReferer(get_url('administration'));
     }
     // if
     $options = $category->getOptions(false);
     $categories = ConfigCategories::getAll(false);
     tpl_assign('category', $category);
     tpl_assign('options', $options);
     tpl_assign('config_categories', $categories);
     $submitted_values = array_var($_POST, 'options');
     if (is_array($submitted_values)) {
         foreach ($options as $option) {
             $new_value = array_var($submitted_values, $option->getName());
             if (is_null($new_value) || $new_value == $option->getValue()) {
                 continue;
             }
             $option->setValue($new_value);
             $option->save();
         }
         // foreach
         flash_success(lang('success update config category', $category->getDisplayName()));
         $this->redirectTo('administration', 'configuration');
     }
     // if
     $this->setSidebar(get_template_path('update_category_sidebar', 'config'));
 }
开发者ID:469306621,项目名称:Languages,代码行数:41,代码来源:ConfigController.class.php


示例2: index

 /**
  * Show invoicing settings panel
  *
  * @param void
  * @return null
  */
 function index()
 {
     require_once INVOICING_MODULE_PATH . '/models/InvoicePdfGenerator.class.php';
     $paper_formats = array(PAPER_FORMAT_A4, PAPER_FORMAT_A3, PAPER_FORMAT_A5, PAPER_FORMAT_LETTER, PAPER_FORMAT_LEGAL);
     $paper_orientations = array(PAPER_ORIENTATION_PORTRAIT, PAPER_ORIENTATION_LANDSCAPE);
     $pdf_settings_data = $this->request->post('pdf_settings');
     if (!is_array($pdf_settings_data)) {
         $pdf_settings_data = array('paper_format' => ConfigOptions::getValue('invoicing_pdf_paper_format'), 'paper_orientation' => ConfigOptions::getValue('invoicing_pdf_paper_orientation'), 'header_text_color' => ConfigOptions::getValue('invoicing_pdf_header_text_color'), 'page_text_color' => ConfigOptions::getValue('invoicing_pdf_page_text_color'), 'border_color' => ConfigOptions::getValue('invoicing_pdf_border_color'), 'background_color' => ConfigOptions::getValue('invoicing_pdf_background_color'));
     }
     // if
     if ($this->request->isSubmitted()) {
         db_begin_work();
         ConfigOptions::setValue('invoicing_pdf_paper_format', array_var($pdf_settings_data, 'paper_format', 'A4'));
         ConfigOptions::setValue('invoicing_pdf_paper_orientation', array_var($pdf_settings_data, 'paper_orientation', 'Portrait'));
         ConfigOptions::setValue('invoicing_pdf_header_text_color', array_var($pdf_settings_data, 'header_text_color', '000000'));
         ConfigOptions::setValue('invoicing_pdf_page_text_color', array_var($pdf_settings_data, 'page_text_color', '000000'));
         ConfigOptions::setValue('invoicing_pdf_border_color', array_var($pdf_settings_data, 'border_color', '000000'));
         ConfigOptions::setValue('invoicing_pdf_background_color', array_var($pdf_settings_data, 'background_color', 'FFFFFF'));
         db_commit();
         flash_success('Successfully modified PDF settings');
         $this->redirectTo('admin_invoicing_pdf');
     }
     // if
     $this->smarty->assign(array('paper_formats' => $paper_formats, 'paper_orientations' => $paper_orientations, 'pdf_settings_data' => $pdf_settings_data));
 }
开发者ID:NaszvadiG,项目名称:activecollab_loc,代码行数:31,代码来源:PdfSettingsAdminController.class.php


示例3: delete

 /**
  * Delete version
  *
  * @param void
  * @return null
  */
 function delete()
 {
     if ($this->request->isSubmitted()) {
         if (!$this->active_page_version->canDelete($this->logged_user)) {
             $this->httpError(HTTP_ERR_FORBIDDEN);
         }
         // if
         $delete = $this->active_page_version->delete();
         if ($delete && !is_error($delete)) {
             if ($this->request->isAsyncCall()) {
                 $this->httpOk();
             } else {
                 flash_success('Version #:version has been deleted', array('version' => $this->active_page_version->getVersion()));
             }
             // if
         } else {
             if ($this->request->isAsyncCall()) {
                 $this->httpError(HTTP_ERR_OPERATION_FAILED);
             } else {
                 flash_success('Failed to delete version #:version', array('version' => $this->active_page_version->getVersion()));
             }
             // if
         }
         // if
         $this->redirectToUrl($this->active_page->getViewUrl());
     } else {
         $this->httpError(HTTP_ERR_BAD_REQUEST);
     }
     // if
 }
开发者ID:NaszvadiG,项目名称:activecollab_loc,代码行数:36,代码来源:PageVersionsController.class.php


示例4: index

 /**
  * Settings form
  * 
  * @param void
  * @return null
  */
 function index()
 {
     js_assign('test_svn_url', assemble_url('admin_source_test_svn'));
     $source_data = $this->request->post('source');
     if (!is_foreachable($source_data)) {
         $source_data = array('svn_path' => ConfigOptions::getValue('source_svn_path'), 'svn_config_dir' => ConfigOptions::getValue('source_svn_config_dir'), 'source_svn_use_output_redirect' => ConfigOptions::getValue('source_svn_use_output_redirect'), 'source_svn_trust_server_cert' => ConfigOptions::getValue('source_svn_trust_server_cert'));
     }
     // if
     if ($this->request->isSubmitted()) {
         $svn_path = array_var($source_data, 'svn_path', null);
         $svn_path = $svn_path ? with_slash($svn_path) : null;
         ConfigOptions::setValue('source_svn_path', $svn_path);
         $svn_config_dir = array_var($source_data, 'svn_config_dir') == '' ? null : array_var($source_data, 'svn_config_dir');
         ConfigOptions::setValue('source_svn_config_dir', $svn_config_dir);
         $svn_use_output_redirection = array_var($source_data, 'source_svn_use_output_redirect') == "1";
         ConfigOptions::setValue('source_svn_use_output_redirect', $svn_use_output_redirection);
         $svn_trust_server_certificate = array_var($source_data, 'source_svn_trust_server_cert') == "1";
         ConfigOptions::setValue('source_svn_trust_server_cert', $svn_trust_server_certificate);
         flash_success("Source settings successfully saved");
         $this->redirectTo('admin_source');
     }
     // if
     if (!RepositoryEngine::executableExists()) {
         $this->wireframe->addPageMessage(lang("SVN executable not found. You won't be able to use this module"), 'error');
     }
     // if
     $this->smarty->assign(array('source_data' => $source_data));
 }
开发者ID:NaszvadiG,项目名称:activecollab_loc,代码行数:34,代码来源:SourceAdminController.class.php


示例5: add

 function add()
 {
     $pt = DB::escape(array_var($_GET, 'pt'));
     $t = DB::escape(array_var($_GET, 't'));
     $dep = ProjectTaskDependencies::findOne(array('conditions' => "`previous_task_id` = {$pt} AND `task_id` = {$t}"));
     if (!$dep instanceof ProjectTaskDependency) {
         try {
             DB::beginWork();
             $dep = new ProjectTaskDependency();
             $dep->setPreviousTaskId(array_var($_GET, 'pt'));
             $dep->setTaskId(array_var($_GET, 't'));
             $dep->save();
             DB::commit();
         } catch (Exception $e) {
             flash_error($e->getMessage());
             DB::rollback();
         }
     }
     flash_success(lang('success add task dependency'));
     $reload = array_var($_GET, 'reload', true);
     if ($reload) {
         ajx_current("reload");
     } else {
         ajx_current("empty");
     }
 }
开发者ID:abhinay100,项目名称:feng_app,代码行数:26,代码来源:TaskdependencyController.class.php


示例6: index

 /**
  * Show pages
  * 
  * @param string $type 
  */
 public function index($action = '', $subaction = NULL)
 {
     new Menu_Tabs('pages', Url::gear('pages'));
     switch ($action) {
         case 'create':
             if (!page_access('pages create')) {
                 return;
             }
             $form = new Form('Pages.createdit');
             if ($result = $form->result()) {
                 $page = new Pages_Object();
                 $page->object($result);
                 $page->aid = cogear()->user->id;
                 $page->created_date = time();
                 $page->last_update = time();
                 $page->save();
                 flash_success(t('New page has been successfully added!', 'Pages'));
                 redirect($page->getUrl());
             }
             append('content', $form->render());
             break;
         case 'show':
             $this->showPage($subaction);
             break;
         case 'edit':
             $page = new Pages_Object();
             $page->where('id', intval($subaction));
             if ($page->find()) {
                 if (access('pages edit_all') or $cogear->user->id == $page->aid) {
                     $form = new Form('Pages.createdit');
                     $form->init();
                     if (access('pages delete')) {
                         $form->addElement('delete', array('label' => t('Delete'), 'type' => 'submit'));
                     }
                     $form->setValues($page->object());
                     if ($result = $form->result()) {
                         if ($result->delete) {
                             $page->delete();
                             redirect(Url::gear('pages'));
                         }
                         $page->object()->mix($result);
                         $page->last_update = time();
                         $page->update();
                         $link = $page->getUrl();
                         success(t('Page has been update. You can visit it by link <a href="%s">%s</a>', 'Pages', $link, $link));
                         //redirect($page->getUrl());
                     }
                     $form->elements->submit->setValue(t('Update'));
                     append('content', $form->render());
                 } else {
                     return _403();
                 }
             } else {
                 return _404();
             }
             break;
         default:
             $this->showPages($action);
     }
 }
开发者ID:romartyn,项目名称:cogear,代码行数:65,代码来源:Gear.php


示例7: enable_all_context_help

 function enable_all_context_help()
 {
     $context_help_options = UserWsConfigOptions::getOptionsByCategoryName('context help', true);
     foreach ($context_help_options as $option) {
         set_user_config_option($option->getName(), true, logged_user()->getId());
     }
     ajx_current("empty");
     flash_success(lang('success enable all context help'));
 }
开发者ID:pnagaraju25,项目名称:fengoffice,代码行数:9,代码来源:HelpController.class.php


示例8: admin_action

 /**
  * Настройки
  */
 public function admin_action()
 {
     $form = new Form(array('#name' => 'admin.parser', 'title' => array('label' => t('Настройки')), 'nl2br' => array('type' => 'checkbox', 'label' => t('Автоматическая обработка строк'), 'value' => config('Parser.nl2br')), 'save' => array()));
     if ($result = $form->result()) {
         $this->set('Parser.nl2br', $result->nl2br);
         flash_success(t('Настройки сохранены!'));
         reload();
     }
     $form->show();
 }
开发者ID:brussens,项目名称:cogear2,代码行数:13,代码来源:Gear.php


示例9: show_context_help

 function show_context_help()
 {
     $show_context_help = array_var($_GET, 'show_context_help');
     set_user_config_option('show_context_help', $show_context_help, logged_user()->getId());
     ajx_current("empty");
     if ($show_context_help == 'until_close') {
         flash_success(lang('success enable context help'));
     } else {
         flash_success(lang('success disable context help'));
     }
 }
开发者ID:abhinay100,项目名称:feng_app,代码行数:11,代码来源:HelpController.class.php


示例10: delete_state

 function delete_state()
 {
     $this->setTemplate(get_template_path('back'));
     ajx_current("empty");
     try {
         $query = "DELETE FROM `" . TABLE_PREFIX . "guistate` WHERE `contact_id` = " . DB::escape(logged_user()->getId());
         DB::executeAll($query);
         flash_success(lang("success reset gui state"));
     } catch (Exception $e) {
         flash_error($e->getMessage());
     }
 }
开发者ID:abhinay100,项目名称:feng_app,代码行数:12,代码来源:GuiController.class.php


示例11: index

 /**
  * Reset access data
  * 
  * @param string $action 
  */
 public function index($action = NULL)
 {
     if ($this->user->id != 1) {
         back();
     }
     switch ($action) {
         case 'reset':
             $this->clear();
             flash_success(t('Access rights have been reseted successfully!', 'Access'));
             back();
             break;
     }
 }
开发者ID:romartyn,项目名称:cogear,代码行数:18,代码来源:Gear.php


示例12: delete

 /**
  * Delete specific user
  *
  * @access public
  * @param void
  * @return null
  */
 function delete()
 {
     $this->setTemplate('del_user');
     $user = Users::findById(get_id());
     if (!$user instanceof User) {
         flash_error(lang('user dnx'));
         $this->redirectTo('administration');
     }
     // if
     if (!$user->canDelete(logged_user())) {
         flash_error(lang('no access permissions'));
         $this->redirectToReferer(get_url('dashboard'));
     }
     // if
     $delete_data = array_var($_POST, 'deleteUser');
     tpl_assign('user', $user);
     tpl_assign('delete_data', $delete_data);
     if (!is_array($delete_data)) {
         $delete_data = array('really' => 0, 'password' => '');
         // array
         tpl_assign('delete_data', $delete_data);
     } else {
         if ($delete_data['really'] == 1) {
             $password = $delete_data['password'];
             if (trim($password) == '') {
                 tpl_assign('error', new Error(lang('password value missing')));
                 return $this->render();
             }
             if (!logged_user()->isValidPassword($password)) {
                 tpl_assign('error', new Error(lang('invalid login data')));
                 return $this->render();
             }
             try {
                 DB::beginWork();
                 $user->delete();
                 ApplicationLogs::createLog($user, null, ApplicationLogs::ACTION_DELETE);
                 DB::commit();
                 flash_success(lang('success delete user', $user->getDisplayName()));
             } catch (Exception $e) {
                 DB::rollback();
                 flash_error(lang('error delete user'));
             }
             // try
             $this->redirectToUrl($user->getCompany()->getViewUrl());
         } else {
             flash_error(lang('error delete user'));
             $this->redirectToUrl($user->getCompany()->getViewUrl());
         }
     }
 }
开发者ID:bklein01,项目名称:Project-Pier,代码行数:57,代码来源:UserController.class.php


示例13: __construct

 function __construct($request)
 {
     parent::__construct($request);
     $three_o_four_data = $this->request->post('three_o_four');
     if (!is_array($three_o_four_data)) {
         $three_o_four_data = array('etag_enabled' => ConfigOptions::getValue('three_o_four_etag_enabled'), 'response_cache_enabled' => ConfigOptions::getValue('three_o_four_response_cache_enabled'));
     }
     // if
     $this->smarty->assign(array('three_o_four' => $three_o_four_data));
     if ($this->request->isSubmitted()) {
         ConfigOptions::setValue('three_o_four_etag_enabled', array_var($three_o_four_data, 'etag_enabled', null));
         ConfigOptions::setValue('three_o_four_response_cache_enabled', array_var($three_o_four_data, 'response_cache_enabled', null));
         flash_success('Cache settings have been updated');
         $this->redirectTo('three_o_four_settings');
     }
 }
开发者ID:nischu7,项目名称:ac-304,代码行数:16,代码来源:ThreeOFourSettingsController.class.php


示例14: index

 /**
  * Main Backup page
  *
  */
 function index()
 {
     $backup_data = $this->request->post('backup');
     if (!is_array($backup_data)) {
         $backup_data = array('enabled' => $this->backup_enabled, 'how_many_backups' => $this->how_many_backups);
     }
     // if
     $this->smarty->assign(array('backup_data' => $backup_data, 'how_many_values' => array(3, 5, 10, 15, 30, 60)));
     if ($this->request->isSubmitted()) {
         ConfigOptions::setValue('backup_enabled', (bool) array_var($backup_data, 'enabled', 0));
         $how_many = (int) array_var($backup_data, 'how_many_backups', 5);
         ConfigOptions::setValue('backup_how_many_backups', $how_many < 0 ? 5 : $how_many);
         flash_success('Backup settings have been updated');
         $this->redirectTo('admin');
     }
     // if
 }
开发者ID:NaszvadiG,项目名称:activecollab_loc,代码行数:21,代码来源:BackupAdminController.class.php


示例15: index

 /**
  * PublicSubmitAdmin index page
  *
  */
 function index()
 {
     $public_submit_data = $this->request->post('public_submit');
     if (!is_array($public_submit_data)) {
         $public_submit_data = array('project_id' => ConfigOptions::getValue('public_submit_default_project'), 'enabled' => ConfigOptions::getValue('public_submit_enabled'), 'captcha' => ConfigOptions::getValue('public_submit_enable_captcha'));
     }
     // if
     $this->smarty->assign(array('public_submit_data' => $public_submit_data));
     if ($this->request->isSubmitted()) {
         ConfigOptions::setValue('public_submit_default_project', array_var($public_submit_data, 'project_id', null));
         ConfigOptions::setValue('public_submit_enabled', array_var($public_submit_data, 'enabled', null));
         ConfigOptions::setValue('public_submit_enable_captcha', array_var($public_submit_data, 'captcha', null));
         flash_success('Public Submit settings have been updated');
         $this->redirectTo('admin_settings_public_submit');
     }
     // if
 }
开发者ID:NaszvadiG,项目名称:activecollab_loc,代码行数:21,代码来源:PublicSubmitAdminController.class.php


示例16: index

 /**
  * Index page
  * 
  * @param void
  * @return null
  */
 function index()
 {
     js_assign('invoicing_precision', INVOICE_PRECISION);
     $this->wireframe->addBreadCrumb(lang('Invoicing'), assemble_url('admin'));
     $this->wireframe->addBreadCrumb(lang('Number Generator'), assemble_url('admin_invoicing_number'));
     // prepare javascript variables and counters for preview
     $pattern = Invoices::getInvoiceNumberGeneratorPattern();
     list($total_counter, $year_counter, $month_counter) = Invoices::getDateInvoiceCounters();
     $total_counter++;
     $year_counter++;
     $month_counter++;
     $variable_year = date('Y');
     $variable_month = date('n');
     $variable_month_short = date('M');
     $variable_month_long = date('F');
     js_assign('pattern_variables', array(INVOICE_VARIABLE_CURRENT_YEAR => $variable_year, INVOICE_VARIABLE_CURRENT_MONTH => $variable_month, INVOICE_VARIABLE_CURRENT_MONTH_SHORT => $variable_month_short, INVOICE_VARIABLE_CURRENT_MONTH_LONG => $variable_month_long, INVOICE_NUMBER_COUNTER_TOTAL => $total_counter, INVOICE_NUMBER_COUNTER_YEAR => $year_counter, INVOICE_NUMBER_COUNTER_MONTH => $month_counter));
     $generator_data = $this->request->post('generator');
     if (!is_foreachable($generator_data)) {
         $generator_data = array('pattern' => Invoices::getinvoiceNumberGeneratorPattern());
     }
     // if
     $this->smarty->assign(array('generator_data' => $generator_data));
     if ($this->request->isSubmitted()) {
         $errors = new ValidationErrors();
         $posted_pattern = array_var($generator_data, 'pattern', null);
         if (!trim($posted_pattern)) {
             $errors->addError(lang('Pattern is required'), 'pattern');
         }
         // if
         if (strpos($posted_pattern, INVOICE_NUMBER_COUNTER_TOTAL) === false && strpos($posted_pattern, INVOICE_NUMBER_COUNTER_YEAR) === false && strpos($posted_pattern, INVOICE_NUMBER_COUNTER_MONTH) === false) {
             $errors->addError(lang('One of invoice counters is required (:total, :year, :month)', array('total' => INVOICE_NUMBER_COUNTER_TOTAL, 'year' => INVOICE_NUMBER_COUNTER_YEAR, 'month' => INVOICE_NUMBER_COUNTER_MONTH)), 'pattern');
         }
         // if
         if ($errors->hasErrors()) {
             $this->smarty->assign(array('errors' => $errors));
         } else {
             Invoices::setInvoiceNumberGeneratorPattern($posted_pattern);
             flash_success('Pattern for invoice number generator is saved');
             $this->redirectTo('admin');
         }
         // if
     }
     // if
 }
开发者ID:NaszvadiG,项目名称:activecollab_loc,代码行数:50,代码来源:InvoiceNumberGeneratorAdminController.class.php


示例17: showForm

 /**
  * Show comment post form
  * 
  * @param object $Page 
  */
 public function showForm($Page)
 {
     if (access('comments post')) {
         $form = new Form('Comments.add');
         if ($result = $form->result()) {
             $comment = new Comments_Object();
             $comment->pid = $Page->id;
             $comment->aid = $this->user->id;
             $comment->created_date = time();
             $comment->body = $result->body;
             $comment->ip = $this->session->ip;
             if ($comment->save()) {
                 $Page->comments = $this->db->where('pid', $Page->id)->count('comments');
                 $Page->save();
                 flash_success(t('Your comment has been successfully posted!'));
                 redirect($Page->getUrl());
             }
         }
         $form->show();
     }
 }
开发者ID:romartyn,项目名称:cogear,代码行数:26,代码来源:Gear.php


示例18: index

 /**
  * Show and process manage categories page
  *
  * @param void
  * @return null
  */
 function index()
 {
     $category_definitions = array();
     event_trigger('on_master_categories', array(&$category_definitions));
     $this->smarty->assign('category_definitions', $category_definitions);
     if ($this->request->isSubmitted()) {
         if (is_foreachable($category_definitions)) {
             foreach ($category_definitions as $category_definition) {
                 $value = $this->request->post($category_definition['name']);
                 if (!is_array($value) || count($value) < 1) {
                     $value = array(lang('General'));
                 }
                 // if
                 ConfigOptions::setValue($category_definition['name'], $value);
             }
             // foreach
         }
         // if
         flash_success('Master categories have been updated');
         $this->redirectTo('admin');
     }
     // if
 }
开发者ID:NaszvadiG,项目名称:activecollab_loc,代码行数:29,代码来源:CategoriesAdminController.class.php


示例19: delete_logo

 /**
  * Delete locale logo
  *
  * @param void
  * @return null
  */
 function delete_logo()
 {
     $locale = I18nLocales::findById(get_id());
     if (!$locale instanceof I18nLocale) {
         flash_error(lang('locale dnx'));
         $this->redirectToReferer(get_url('i18n', 'index'));
     }
     // if
     if (!$locale->canEdit(logged_user())) {
         flash_error(lang('no access permissions'));
         $this->redirectTo('i18n', 'index');
     }
     // if
     try {
         DB::beginWork();
         $locale->deleteLogo();
         $locale->save();
         ApplicationLogs::createLog($locale, 0, ApplicationLogs::ACTION_EDIT);
         DB::commit();
         flash_success(lang('success delete logo'));
     } catch (Exception $e) {
         DB::rollback();
         flash_error(lang('error delete logo', $e));
     }
     // try
     $this->redirectToUrl($locale->getEditLogoUrl());
 }
开发者ID:bklein01,项目名称:Project-Pier,代码行数:33,代码来源:I18nController.class.php


示例20: register_action

 /**
  * User Регистрация
  */
 public function register_action($code = NULL)
 {
     $this->theme->template('User/templates/login');
     if (!config('user.register.active', FALSE)) {
         return error(t('Регистрация отключена администрацией сайта.'));
     }
     if ($this->isLogged()) {
         return error('Вы уже авторизированы!');
     }
     $this->showMenu();
     if ($code) {
         $user = new User();
         $user->hash = $code;
         if ($user->find()) {
             $form = new Form('User/forms/verify');
             $form->email->setValue($user->email);
             if ($result = $form->result()) {
                 $user->object()->extend($result);
                 $result->realname && ($user->name = $result->realname);
                 $user->hashPassword();
                 $user->hash = $this->secure->genHash($user->password);
                 $user->reg_date = time();
                 $user->last_visit = time();
                 if ($user->save()) {
                     event('user.register', $user);
                     if ($user->login()) {
                         flash_success(t('Регистрация завершена!'));
                         redirect($user->getLink());
                     }
                 }
             }
             $form->show();
         } else {
             error(t('Регистрационный код не найден.'));
         }
     } else {
         $form = new Form('User/forms/register');
         if ($result = $form->result()) {
             $user = new User();
             $user->email = $result->email;
             $user->find();
             $user->hash = $this->secure->genHash(date('H d.m.Y') . $this->session->get('ip') . $result->email);
             if (config('user.register.verification', TRUE)) {
                 $verify_link = l('/user/register/' . $user->hash, TRUE);
                 $mail = new Mail(array('name' => 'register.verify', 'subject' => t('Регистрация на сайте %s', SITE_URL), 'body' => t('Вы успешно зарегистрировались на сайте http://%s. <br/>
                         Пожалуйста, перейдите по ссылке ниже, для того чтобы подтвердить данный почтовый ящик:<p>
                         <a href="%s">%s</a>', SITE_URL, $verify_link, $verify_link)));
                 $mail->to($user->email);
                 if ($mail->send()) {
                     $user->save();
                     event('user.confirmation', $user);
                     success(t('Письмо с подтвержденим регистрации было отправлено на почтовый адрес <b>%s</b>. Следуйте инструкциям.', $user->email));
                 }
             } else {
                 $user->save();
                 redirect(l('/user/register/' . $user->hash));
             }
         } else {
             $form->show();
         }
     }
 }
开发者ID:brussens,项目名称:cogear2,代码行数:65,代码来源:Gear.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP flashdata函数代码示例发布时间:2022-05-15
下一篇:
PHP flash_now函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap