Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 16455a4f

Von Moritz Bunkus vor mehr als 11 Jahren hinzugefügt

  • ID 16455a4f7a2e871d645485ffb5904d197b907217
  • Vorgänger 6f398b35
  • Nachfolger 576c2a14

admin.pl Nicht mehr benötigte Funktionen entfernt & Redirect auf neue Loginadresse

Unterschiede anzeigen:

bin/mozilla/admin.pl
107 107
}
108 108

  
109 109
sub adminlogin {
110
  my $form   = $main::form;
111
  my $locale = $main::locale;
112

  
113
  $form->{title} = qq|kivitendo $form->{version} | . $locale->text('Administration');
114

  
115
  $form->header();
116
  print $form->parse_html_template('admin/adminlogin');
117
}
118

  
119
sub login_name {
120
  my $login = shift;
121

  
122
  $login =~ s/\[\]//g;
123
  return ($login) ? $login : undef;
124

  
125
}
126

  
127
sub get_value {
128
  my $line           = shift;
129
  my ($null, $value) = split(/=/, $line, 2);
130

  
131
  # remove comments
132
  $value =~ s/\s#.*//g;
133

  
134
  # remove any trailing whitespace
135
  $value =~ s/^\s*(.*?)\s*$/$1/;
136

  
137
  $value;
110
  print $::request->cgi->redirect('controller.pl?action=Admin/login');
138 111
}
139 112

  
140 113
sub pg_database_administration {
......
160 133
  print $form->parse_html_template("admin/dbadmin");
161 134
}
162 135

  
163
sub test_db_connection {
164
  my $form   = $main::form;
165
  my $locale = $main::locale;
166

  
167
  User::dbconnect_vars($form, $form->{dbname});
168

  
169
  my $dbh = DBI->connect($form->{dbconnect}, $form->{dbuser}, $form->{dbpasswd});
170

  
171
  $form->{connection_ok} = $dbh ? 1 : 0;
172
  $form->{errstr}        = $DBI::errstr;
173

  
174
  $dbh->disconnect() if ($dbh);
175

  
176
  $form->{title} = $locale->text('Database Connection Test');
177
  $form->header();
178
  print $form->parse_html_template("admin/test_db_connection");
179
}
180

  
181 136
sub continue {
182 137
  call_sub($main::form->{"nextsub"});
183 138
}
......
571 526
  rmdir $tmpdir;
572 527
}
573 528

  
574
sub yes {
575
  call_sub($main::form->{yes_nextsub});
576
}
577

  
578
sub no {
579
  call_sub($main::form->{no_nextsub});
580
}
581

  
582
sub add {
583
  call_sub($main::form->{add_nextsub});
584
}
585

  
586
sub edit {
587
  my $form = $main::form;
588

  
589
  $form->{edit_nextsub} ||= 'edit_user';
590

  
591
  call_sub($form->{edit_nextsub});
592
}
593

  
594
sub delete {
595
  my $form     = $main::form;
596

  
597
  $form->{delete_nextsub} ||= 'delete_user';
598

  
599
  call_sub($form->{delete_nextsub});
600
}
601

  
602
sub save {
603
  my $form = $main::form;
604

  
605
  $form->{save_nextsub} ||= 'save_user';
606

  
607
  call_sub($form->{save_nextsub});
608
}
609

  
610
sub back {
611
  call_sub($main::form->{back_nextsub});
612
}
613

  
614
sub dispatcher {
615
  my $form   = $main::form;
616
  my $locale = $main::locale;
617

  
618
  foreach my $action (qw(create_standard_group dont_create_standard_group
619
                         save_user delete_user save_user_as_new)) {
620
    if ($form->{"action_${action}"}) {
621
      call_sub($action);
622
      return;
623
    }
624
  }
625

  
626
  call_sub($form->{default_action}) if ($form->{default_action});
627

  
628
  $form->error($locale->text('No action defined.'));
629
}
630

  
631
sub _search_templates {
632
  my %templates = SL::Template->available_templates;
633

  
634
  return ($templates{print_templates}, $templates{master_templates});
635
}
636

  
637 529
1;

Auch abrufbar als: Unified diff