save_group => [\&html_start, \&action_save_group, \&html_end]
);
-read_config ();
+{
+ my @files = (qw(/etc/licom/licom.conf));
+ push (@files, './licom.conf') if (-r './licom.conf');
+ read_config (@files);
+}
# make sure AuthLDAPRemoteUserIsDN is enabled.
die unless ($ENV{'REMOTE_USER'});
if (!$UserCN)
{
- die ("No such user in the LDAP directory: " . $ENV{'REMOTE_USER'});
+ die ("UserCN is not set. Make sure `AuthLDAPRemoteUserIsDN' in enabled.");
}
if (!defined ($Actions{$Action}))
EOF
if ($UserID)
{
- print qq(\t\t\t\t<td><input type="text" name="lastname" value="$lastname_html" /></td>\n);
+ print <<HTML;
+ <td><input type="text" name="lastname" value="$lastname_html"
+ onChange="updateTextbox ('lastname');"
+ onKeyUp="updateTextbox ('lastname');"
+ onBlur="updateTextbox ('lastname');"
+ /></td>
+HTML
}
else
{
EOF
if ($UserID)
{
- print qq(\t\t\t\t<td><input type="text" name="firstname" value="$firstname_html" /></td>\n);
+ print <<HTML;
+ <td><input type="text" name="firstname" value="$firstname_html"
+ onChange="updateTextbox ('firstname');"
+ onKeyUp="updateTextbox ('firstname');"
+ onBlur="updateTextbox ('firstname');"
+ /></td>
+HTML
}
else
{
print <<EOF;
<tr>
<th>$print</th>
- <td><input type="text" name="$field" value="$value" /></td>
+ <td><input type="text" name="$field" value="$value"
+ onChange="updateTextbox ('$field');"
+ onKeyUp="updateTextbox ('$field');"
+ onBlur="updateTextbox ('$field');"
+ /></td>
</tr>
EOF
}
"\t\t\t</tr>\n";
}
- print "\t\t\t<tr>\n",
- "\t\t\t\t<th>New Group</th>\n",
- qq(\t\t\t\t<td><input type="text" name="newgroup" value="" /></td>\n),
- "\t\t\t</tr>\n";
+ print <<HTML;
+ <tr>
+ <th>New Group</th>
+ <td><input type="text" name="newgroup" value=""
+ onChange="updateTextbox ('newgroup');"
+ onKeyUp="updateTextbox ('newgroup');"
+ onBlur="updateTextbox ('newgroup');"
+ /></td>
+ </tr>
+HTML
}
print <<EOF;
my $old_cn = $person->name ();
- print <<HTML;
-<div><code>
- \$lastname = $lastname<br />
- \$firstname = $firstname<br />
- \$old_cn = $old_cn
-</code></div>
-HTML
-
$person->lastname ($lastname) if ($lastname and $lastname ne $person->lastname ());
$person->firstname ($firstname) if ($firstname and $firstname ne $person->firstname ());
# ->del_members automatically deleted the
# group, if no more members exist. So this
# order is important.
- print "<div><code>\$cn = " . encode_entities ($cn) . "; "
- . "\$old_cn = " . encode_entities ($old_cn) . ";</code></div>\n";
$_->add_members ($cn);
$_->del_members ($old_cn);
}
</tr>
<tr>
<th>Description</th>
- <td><input type="text" name="description" value="$desc_html" /></td>
+ <td><input type="text" name="description" value="$desc_html"
+ onChange="updateTextbox ('description');"
+ onKeyUp="updateTextbox ('description');"
+ onBlur="updateTextbox ('description');"
+ /></td>
</tr>
<tr>
<th colspan="2"><input type="submit" name="button" value="Save" /></th>
<html>
<head>
<title>$title</title>
- <style type="text/css">
- <!--
- \@media screen
- {
- a
- {
- color: blue;
- background-color: inherit;
- text-decoration: none;
- }
-
- a:hover
- {
- text-decoration: underline;
- }
-
- a:visited
- {
- color: navy;
- background-color: inherit;
- }
-
- body
- {
- color: black;
- background-color: white;
- }
-
- div.error
- {
- color: red;
- background-color: yellow;
-
- font-weight: bold;
- padding: 1ex;
- border: 2px solid red;
- }
-
- div.foot
- {
- color: gray;
- background-color: white;
-
- position: fixed;
- top: auto;
- right: 0px;
- bottom: 0px;
- left: 0px;
-
- font-size: x-small;
- text-align: right;
- border-top: 1px solid black;
- width: 100%;
- }
-
- div.foot a
- {
- color: black;
- background-color: inherit;
- text-decoration: none;
- }
-
- div.foot a:hover
- {
- text-decoration: underline;
- }
-
- div.menu
- {
- border-top: 1px solid black;
- margin-top: 1ex;
- font-weight: bold;
- }
-
- div.menu a
- {
- color: blue;
- background-color: transparent;
- }
-
- div.topmenu
- {
- margin-bottom: 1ex;
- padding-bottom: 1ex;
- border-bottom: 1px solid black;
- }
-
- div.topmenu form
- {
- display: inline;
- margin-right: 5ex;
- }
-
- h1
- {
- position: absolute;
- top: 1ex;
- right: 1ex;
- bottom: auto;
- left: auto;
-
- font-size: 100%;
- font-weight: bold;
- }
-
- img
- {
- border: none;
- }
-
- table.list
- {
- width: 100%;
- border: 2px solid #d0d0d0;
- }
-
- table.list td
- {
- empty-cells: show;
- }
-
- td
- {
- color: black;
- background-color: #e8e8e8;
- vertical-align: top;
- }
-
- th
- {
- color: black;
- background-color: #d0d0d0;
- padding: 0.3ex;
- text-align: left;
- vertical-align: top;
- }
+ <link rel="stylesheet" type="text/css" href="style.screen.css" media="screen" />
+ <link rel="stylesheet" type="text/css" href="style.print.css" media="print" />
+ <script type="text/javascript" src="html_entities.js"></script>
+ <script type="text/javascript">
+function updateTextbox (name)
+{
+ var arrTb = document.getElementsByName (name);
+ var objTb;
+ var objStr;
- ul.groups li
- {
- margin-top: 0.5ex;
- }
- }
+ if (!arrTb || (arrTb.length < 1))
+ return (true);
- \@media print
+ for (var i = 0; i < arrTb.length; i++)
+ {
+ objStr = decode_entities (arrTb[i].value);
+ if (arrTb[i].value != objStr)
{
- a
- {
- color: inherit;
- background-color: inherit;
- text-decoration: underline;
- }
-
- div.topmenu, div.menu
- {
- display: none;
- }
-
- div.foot
- {
- font-size: 50%;
- text-align: right;
- }
-
- h1
- {
- display: none;
- }
-
- h2
- {
- font-size: 100%;
- }
-
- table
- {
- border-collapse: collapse;
- }
-
- table.list
- {
- width: 100%;
- }
-
- table.list td
- {
- empty-cells: show;
- }
-
- table.list th
- {
- border-bottom-width: 2px;
- }
-
- td, th
- {
- border: 1px solid black;
- vertical-align: top;
- }
-
- th
- {
- font-weight: bold;
- text-align: center;
- }
+ arrTb[i].value = objStr;
+ /* arrTb[i].focus (); */
}
- //-->
- </style>
+ }
+
+ return (true);
+}
+ </script>
</head>
<body>
</form>
<form action="$MySelf" method="post" accept-charset="UTF-8">
<input type="hidden" name="action" value="search" />
- <input type="text" name="search" value="$search" />
+ <input type="text" name="search" value="$search"
+ onChange="updateTextbox ('search');"
+ onKeyUp="updateTextbox ('search');"
+ onBlur="updateTextbox ('search');"
+ />
<input type="submit" name="button" value="Search" />
</form>
<form action="$MySelf" method="post" accept-charset="UTF-8">
if ($value =~ m#^([a-z]+)://(.+)$#)
{
$value_uri = $1 . '://' . uri_escape_utf8 ($2);
+ $value_uri =~ s#%2f#/#gi;
}
else
{
}
elsif ($field eq 'mail')
{
+ $value_uri =~ s/%40/@/g;
return (qq(<a href="mailto:$value_uri" class="mail">$value_html</a>));
}
return ($value_html);