running ql-web

This commit is contained in:
lars 2006-01-24 08:54:12 +00:00
parent 8c46c822d3
commit ed1e2a9eea
8 changed files with 100 additions and 22 deletions

View file

@ -41,14 +41,17 @@ Lang {
Misc {
NewForwardAddress = Neue Weiterleitungsadresse
VacationText = Benachrichtigungstext
Password = Mailaccount-Passwort
OldPassword = Altes Passwort
NewPassword = Neues Passwort
Password = Mailaccount-Passwort
OldPassword = Altes Passwort
NewPassword = Neues Passwort
NewPasswordAgain = Neues Passwort wiederholen
FooterText = eine Web-Oberflaeche fuer
Filter_None = keine Spam-Kontrolle
Filter_Mark = markiere Spam-Nachrichten
Filter_Move = Verschiebe Spam-Nachrichten
FooterText = eine Web-Oberflaeche fuer
Filter_None = keine Spam-Pruefung
Filter_Mark = markiere Spam
Filter_Move = verschiebe Spam in das Spam-Verzeichnis
StatusSpamNone = eingehende Nachrichten werden nicht auf Spam geprueft
StatusSpamMark = Spam wird markiert
StatusSpamMove = Spam wird in das Spam-Verzeichnis verschoben
}
ErrorMessage {
@ -59,6 +62,7 @@ Lang {
WarningMessage {
FilterConnfig = Die Filterungseinstellungen konnten nicht gespeichert werden!
WrongPassword = Das angegebene Passwort war nicht korrekt!
}
@ -76,6 +80,9 @@ Lang {
Legend {
StatusFilter = Spam-Filterung
StatusForward = Weiterleitungen
StatusVacation = Abwesenheitsbenachrichtigungen
Password = Passwort aendern
Forward = Weiterleitungen verwalten
Filter = Spam-Filterung einrichten

View file

@ -1,8 +1,8 @@
$CSS_URL = '/ql-web/css/default.css';
$CSS_URL = '/admin/ql-web/css/default.css';
$HTML_TITLE = 'QL-Web - Entwicklung';
$QL_WEB_DIR = '/home/lars/subversion/admin-tools/ql-web/trunk';
$QL_WEB_DIR = '/data/ql-web';
$TEMPLATE_DIR = "$QL_WEB_DIR/template";
$LANGUAGE_DIR = "$QL_WEB_DIR/lang";
@ -11,8 +11,8 @@ $HTML_LANGUAGE = 'de';
$LDAP_HOST = 'ldap.sao';
# the string '_USERNAME_' will be replaced by the real username
$LDAP_USER_DN = "cn=_USERNAME_,ou=People,o=neofaxe,dc=systemausfall,dc=org";
$LDAP_USER_DN = "cn=_USERNAME_,sc=mailAccount,ou=People,o=neofaxe,dc=systemausfall,dc=org";
$LDAP_SPAM_MOVE = "| ifspam spam-_USERNAME_ || true";
$LDAP_SPAM_MARK = "| ifspam spam-_USERNAME_";
$LDAP_SPAM_MOVE = "| /usr/local/bin/ifspam spam-_USERNAME_";
$LDAP_SPAM_MARK = "| /usr/local/bin/ifspam spam-_USERNAME_ || /bin/true";

View file

@ -138,7 +138,7 @@ sub update_filter {
$user_dn =~ s/_USERNAME_/$mail_user/g;
$ldap = Net::LDAP->new($LDAP_HOST);
$result = $ldap->bind($mail_user, password => $password);
$result = $ldap->bind($user_dn, password => $password);
if ($result->is_error) {
$warning = 'WrongPassword';
return (0==1);
@ -181,12 +181,33 @@ sub update_filter {
# ---------------------------------------------------------------------------
sub is_spam_move {
return &compare_ldap_attr('deliveryProgramPath', $LDAP_SPAM_MOVE);
}
# ---------------------------------------------------------------------------
sub is_spam_mark {
return &compare_ldap_attr('deliveryProgramPath', $LDAP_SPAM_MARK);
}
# ---------------------------------------------------------------------------
sub compare_ldap_attr {
my ($attr, $value) = @_;
my $ldap = Net::LDAP->new($LDAP_HOST);
my $result;
my $user_dn = $LDAP_USER_DN;
$user_dn =~ s/_USERNAME_/$mail_user/g;
$value =~ s/_USERNAME_/$mail_user/g;
$ldap->bind;
$result = $ldap->compare($user_dn,
attr => $attr,
value => $value);
$ldap->unbind;
return ($result->code eq Net::LDAP::Constant->LDAP_COMPARE_TRUE);
}
# ---------------------------------------------------------------------------

View file

@ -7,11 +7,18 @@
<form method="post" action="<?cs var:Config.ScriptName ?>" enctype="application/x-www-form-urlencoded">
<ul>
<li><select name="filter_type">
<option value="none"><?cs var:Lang.Misc.Filter_None ?></option>
<option value="mark"><?cs var:Lang.Misc.Filter_Mark ?></option>
<option value="move"><?cs var:Lang.Misc.Filter_Move ?></option>
</select></li>
<li><input type="radio" name="filter_type" id="filter_none" value="none" <?cs
if:(!(Data.isSpamMove || Data.isSpamMark)) ?>checked="checked"<?cs /if ?>/>
<label for="filter_none"><?cs var:Lang.Misc.Filter_None ?></label>
</li>
<li><input type="radio" name="filter_type" id="filter_mark" value="mark" <?cs
if:Data.isSpamMark ?>checked="checked"<?cs /if ?>/>
<label for="filter_mark"><?cs var:Lang.Misc.Filter_Mark ?></label>
</li>
<li><input type="radio" name="filter_type" id="filter_move" value="move" <?cs
if:Data.isSpamMove ?>checked="checked"<?cs /if ?>/>
<label for="filter_none"><?cs var:Lang.Misc.Filter_Move ?></label>
</li>
<li><label for="pw"><?cs var:html_escape(Lang.Misc.Password) ?>:</label>
<input type="password" name="pw" id="pw" size="20"></li>
</ul>

View file

@ -7,7 +7,7 @@
<form method="post" action="<?cs var:Config.ScriptName ?>" enctype="application/x-www-form-urlencoded">
<ul>
<li>not yet implemented</li>
<li>noch nicht implementiert</li>
<!--
<li><label for="oldpw"><?cs var:html_escape(Lang.Misc.OldPassword) ?>:</label>
<input type="password" name="oldpassword" id="oldpw" size="20"></li>
@ -16,7 +16,7 @@
</ul>
<input type="hidden" name="action" value="forward_update" />
<button type="submit" name="send" value="do"><?cs var:html_escape(Lang.Buttons.Forward) ?></button>
<button type="submit" name="send" value="do"><?cs var:html_escape(Lang.Buttons.AddForward) ?></button>
</form>
</fieldset>

View file

@ -1 +1,21 @@
mainly empty
<div class="title">
<h1><?cs var:html_escape(Lang.Title.Overview) ?></h1>
</div>
<fieldset>
<legend><?cs var:html_escape(Lang.Legend.StatusForward) ?> </legend>
<p>noch nicht implementiert</p>
</fieldset>
<fieldset>
<legend><?cs var:html_escape(Lang.Legend.StatusFilter) ?> </legend>
<p><?cs if:Data.isSpamMove ?><?cs var:Lang.Misc.StatusSpamMove ?><?cs
elif:Data.isSpamMark ?><?cs var:Lang.Misc.StatusSpamMark ?><?cs
else ?><?cs var:Lang.Misc.StatusSpamNone ?><?cs /if ?>
</p>
</fieldset>
<fieldset>
<legend><?cs var:html_escape(Lang.Legend.StatusVacation) ?> </legend>
<p>noch nicht implementiert</p>
</fieldset>

View file

@ -7,6 +7,7 @@
<form method="post" action="<?cs var:Config.ScriptName ?>" enctype="application/x-www-form-urlencoded">
<ul>
<li>noch nicht implementiert</li>
<li><label for="oldpw"><?cs var:html_escape(Lang.Misc.OldPassword) ?>:</label>
<input type="password" name="oldpassword" id="oldpw" size="20"></li>
<li><label for="newpw"><?cs var:html_escape(Lang.Misc.NewPassword) ?>:</label>

View file

@ -0,0 +1,22 @@
<div class="title">
<h1><?cs var:html_escape(Lang.Title.Vacation) ?></h1>
</div>
<fieldset class="form">
<legend><?cs var:html_escape(Lang.Legend.Vacation) ?> </legend>
<form method="post" action="<?cs var:Config.ScriptName ?>" enctype="application/x-www-form-urlencoded">
<ul>
<li>noch nicht implementiert</li>
<!--
<li><label for="oldpw"><?cs var:html_escape(Lang.Misc.OldPassword) ?>:</label>
<input type="password" name="oldpassword" id="oldpw" size="20"></li>
-->
</ul>
<input type="hidden" name="action" value="vacation_update" />
<button type="submit" name="send" value="do"><?cs var:html_escape(Lang.Buttons.Vacation) ?></button>
</form>
</fieldset>