Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision c7edb248

Von Sven Schöling vor mehr als 14 Jahren hinzugefügt

  • ID c7edb24800396748f2bf1e40ff05f90a18d31b02
  • Vorgänger 881cc205
  • Nachfolger ea4a7211

Nur ein globales Locale-Objekt anlegen

Außerdem alle lokalen Locale-Objekte entfernt. Ist so noch nicht funktionabel.

Conflicts:

SL/Template/Plugin/T8.pm
scripts/console
scripts/rose_auto_create_model.pl
scripts/sync_with_sugarcrm.pl

Unterschiede anzeigen:

bin/mozilla/login.pl
39 39

  
40 40
our $cgi;
41 41
our $form;
42
our $locale;
43 42
our $auth;
44 43

  
45 44
sub run {
......
48 47

  
49 48
  $cgi    = $::cgi;
50 49
  $form   = $::form;
51
  $locale = $::locale;
52 50
  $auth   = $::auth;
53 51

  
54 52
  $form->{stylesheet} = "lx-office-erp.css";
55 53
  $form->{favicon}    = "favicon.ico";
56 54

  
57 55
  if (SL::Auth::SESSION_EXPIRED == $session_result) {
58
    $form->{error_message} = $locale->text('The session is invalid or has expired.');
56
    $form->{error_message} = $::locale->text('The session is invalid or has expired.');
59 57
    login_screen();
60 58
    ::end_of_request();
61 59
  }
......
67 65
    our %myconfig = $auth->read_user($form->{login}) if ($form->{login});
68 66

  
69 67
    if (!$myconfig{login} || (SL::Auth::OK != $auth->authenticate($form->{login}, $form->{password}, 0))) {
70
      $form->{error_message} = $locale->text('Incorrect Password!');
68
      $form->{error_message} = $::locale->text('Incorrect Password!');
71 69
      login_screen();
72 70
    } else {
73 71
      $auth->set_session_value('login', $form->{login}, 'password', $form->{password});
74 72
      $auth->create_or_refresh_session();
75 73

  
76 74
      $form->{titlebar} .= " - $myconfig{name} - $myconfig{dbname}";
77
      call_sub($locale->findsub($action));
75
      call_sub($::locale->findsub($action));
78 76
    }
79 77
  } else {
80 78
    login_screen();
......
103 101
  $main::lxdebug->enter_sub();
104 102

  
105 103
  unless ($form->{login}) {
106
    login_screen($locale->text('You did not enter a name!'));
104
    login_screen($::locale->text('You did not enter a name!'));
107 105
    ::end_of_request();
108 106
  }
109 107

  
......
113 111
  my $result;
114 112
  if (($result = $user->login($form)) <= -1) {
115 113
    ::end_of_request() if $result == -2;
116
    login_screen($locale->text('Incorrect username or password!'));
114
    login_screen($::locale->text('Incorrect username or password!'));
117 115
    ::end_of_request();
118 116
  }
119 117

  
......
151 149

  
152 150
  # remove the callback to display the message
153 151
  $form->{callback} = "login.pl?action=";
154
  $form->redirect($locale->text('You are logged out!'));
152
  $form->redirect($::locale->text('You are logged out!'));
155 153

  
156 154
  $main::lxdebug->leave_sub();
157 155
}
......
160 158
  $main::lxdebug->enter_sub();
161 159

  
162 160
  my %myconfig = %main::myconfig;
163
  $locale             =  new Locale $myconfig{countrycode}, "login" if ($main::language ne $myconfig{countrycode});
164

  
165 161
  $form->{todo_list}  =  create_todo_list('login_screen' => 1) if (!$form->{no_todo_list});
166 162

  
167 163
  $form->{stylesheet} =  $myconfig{stylesheet};
168
  $form->{title}      =  $locale->text('About');
164
  $form->{title}      =  $::locale->text('About');
169 165

  
170 166
  # create the logo screen
171 167
  $form->header() unless $form->{noheader};
......
177 173

  
178 174
sub show_error {
179 175
  my $template           = shift;
180
  my %myconfig = %main::myconfig;
181
  $locale                = Locale->new($main::language, 'all');
176
  my %myconfig           = %main::myconfig;
182 177
  $myconfig{countrycode} = $main::language;
183 178
  $form->{stylesheet}    = 'css/lx-office-erp.css';
184 179

  

Auch abrufbar als: Unified diff