Changeset 12764 for trunk/register.php


Ignore:
Timestamp:
Dec 18, 2011, 10:46:24 PM (13 years ago)
Author:
mistic100
Message:

feature:2538 Make a unified messages management
use only $pageinfos and $pageerrors vars and and necessary template to all main pages

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/register.php

    r12610 r12764  
    3838}
    3939
    40 $errors = array();
    4140if (isset($_POST['submit']))
    4241{
     
    4443  {
    4544                set_status_header(403);
    46     array_push($errors, 'Invalid/expired form key');
     45    array_push($page['errors'], 'Invalid/expired form key');
    4746  }
    4847
    4948  if ($_POST['password'] != $_POST['password_conf'])
    5049  {
    51     array_push($errors, l10n('please enter your password again'));
     50    array_push($page['errors'], l10n('please enter your password again'));
    5251  }
    5352
    54   $errors =
     53  $page['errors'] =
    5554      register_user($_POST['login'],
    5655                    $_POST['password'],
    5756                    $_POST['mail_address'],
    5857                    true,
    59                     $errors);
     58                    $page['errors']);
    6059
    61   if (count($errors) == 0)
     60  if (count($page['errors']) == 0)
    6261  {
    6362    $user_id = get_userid($_POST['login']);
     
    9291  ));
    9392
    94 //-------------------------------------------------------------- errors display
    95 if (count($errors) != 0)
    96 {
    97   $template->assign('errors', $errors);
    98 }
    99 
    10093// include menubar
    10194$themeconf = $template->get_template_vars('themeconf');
Note: See TracChangeset for help on using the changeset viewer.