~ubuntu-branches/ubuntu/karmic/ldap-account-manager/karmic

« back to all changes in this revision

Viewing changes to templates/profedit/profilemain.php

  • Committer: Bazaar Package Importer
  • Author(s): Roland Gruber
  • Date: 2006-05-14 14:00:29 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20060514140029-chr2mf30u7bajebu
Tags: 1.0.2-1
Updated to new upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
<?php
2
2
/*
3
 
$Id: profilemain.php,v 1.22 2004/12/12 11:27:57 gruberroland Exp $
 
3
$Id: profilemain.php,v 1.27 2006/03/26 17:51:25 gruberroland Exp $
4
4
 
5
5
  This code is part of LDAP Account Manager (http://www.sourceforge.net/projects/lam)
6
 
  Copyright (C) 2003  Roland Gruber
 
6
  Copyright (C) 2003 - 2006  Roland Gruber
7
7
 
8
8
  This program is free software; you can redistribute it and/or modify
9
9
  it under the terms of the GNU General Public License as published by
28
28
* @author Roland Gruber
29
29
*/
30
30
 
 
31
/** security functions */
 
32
include_once("../../lib/security.inc");
31
33
/** helper functions for profiles */
32
34
include_once("../../lib/profiles.inc");
33
35
/** access to LDAP server */
36
38
include_once("../../lib/config.inc");
37
39
 
38
40
// start session
39
 
session_save_path("../../sess");
40
 
@session_start();
 
41
startSecureSession();
41
42
 
42
43
setlanguage();
43
44
 
44
 
$profileClasses = array(
45
 
        array('scope' => 'user', 'title' => _('User profiles'), 'profiles' => ""),
46
 
        array('scope' => 'group', 'title' => _('Group profiles'), 'profiles' => ""),
47
 
        array('scope' => 'host', 'title' => _('Host profiles'), 'profiles' => "")
48
 
);
 
45
$types = $_SESSION['config']->get_ActiveTypes();
 
46
$profileClasses = array();
 
47
for ($i = 0; $i < sizeof($types); $i++) {
 
48
        $profileClasses[] = array(
 
49
                'scope' => $types[$i],
 
50
                'title' => getTypeAlias($types[$i]),
 
51
                'profiles' => "");
 
52
}
 
53
 
49
54
 
50
55
// check if user is logged in, if not go to login
51
56
if (!$_SESSION['ldap'] || !$_SESSION['ldap']->server()) {
53
58
        exit;
54
59
}
55
60
 
56
 
// check if user has pressed submit or abort button
57
 
if ($_POST['submit']) {
58
 
        // on abort go back to main page
59
 
        if ($_POST['abort']) {
60
 
                metaRefresh("../lists/listusers.php");
61
 
        }
62
 
        // on submit forward to other profile pages
63
 
        elseif ($_POST['submit']) {
 
61
// on abort go back to main page
 
62
if (isset($_POST['abort'])) {
 
63
        metaRefresh("../tools.php");
 
64
        exit;
 
65
}
 
66
// check if user has pressed submit button
 
67
elseif (isset($_POST['submit'])) {
 
68
        // forward to other profile pages
 
69
        if ($_POST['submit']) {
64
70
                for ($i = 0; $i < sizeof($profileClasses); $i++) {
65
71
                        // create new profile
66
72
                        if ($_POST['profile'] == ("new" . $profileClasses[$i]['scope'])) {
96
102
 
97
103
echo "<title>LDAP Account Manager</title>\n";
98
104
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../../style/layout.css\">\n";
 
105
for ($i = 0; $i < sizeof($profileClasses); $i++) {
 
106
        echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../../style/type_" . $profileClasses[$i]['scope'] . ".css\">\n";
 
107
}
99
108
echo "</head>\n";
100
109
echo "<body>\n";
101
110
 
105
114
 
106
115
for ($i = 0; $i < sizeof($profileClasses); $i++) {
107
116
 
108
 
        echo "<fieldset>\n";
 
117
        echo "<fieldset class=\"" . $profileClasses[$i]['scope'] . "edit\">\n";
109
118
        echo "<legend>\n";
110
119
        echo "<b>" . $profileClasses[$i]['title'] . "</b>\n";
111
120
        echo "</legend>\n";
153
162
 
154
163
 
155
164
echo "<p>\n";
156
 
echo "<input type=\"submit\" name=\"submit\" value=\"" . _("Submit") . "\">\n";
157
 
echo "<input type=\"submit\" name=\"abort\" value=\"" . _("Abort") . "\">\n";
 
165
echo "<input type=\"submit\" name=\"submit\" value=\"" . _("Ok") . "\">\n";
 
166
echo "<input type=\"submit\" name=\"abort\" value=\"" . _("Cancel") . "\">\n";
158
167
echo "</p>\n";
159
168
 
160
169
echo "</form>\n";