add addalias functionality
This commit is contained in:
25
action.sh
25
action.sh
@@ -36,7 +36,7 @@ PASS=$(cat "$3")
|
||||
|
||||
## FUNCTIONS
|
||||
function checkaction {
|
||||
REGEX="^adduser$|^changepw$|^listusers$|^userdetail$|^deluser$|^sizeall$|^sizeuser$|^viewdata$"
|
||||
REGEX="^adduser$|^changepw$|^listusers$|^userdetail$|^deluser$|^sizeall$|^sizeuser$|^viewdata$|^addalias$"
|
||||
if [[ $1 =~ $REGEX ]]; then
|
||||
echo "true"
|
||||
else
|
||||
@@ -212,6 +212,29 @@ if [ "$ACTION" == "adduser" ]; then
|
||||
fi
|
||||
fi # /adduser
|
||||
|
||||
# # # # #
|
||||
# ADD ALIAS
|
||||
# # # # #
|
||||
if [ "$ACTION" == "addalias" ]; then
|
||||
echo "Extracting details of Email account..."
|
||||
echo
|
||||
|
||||
DEST=$PASS
|
||||
|
||||
if $(userexists "$USER"); then
|
||||
echo "User \"$USER\" does already exist!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! $(userexists "$DEST"); then
|
||||
echo "Destination account \"$DEST\" does not exist!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
vaddalias $USER $DEST
|
||||
|
||||
fi # /addalias
|
||||
|
||||
# # # # #
|
||||
# CHANGE PASSWORD
|
||||
# # # # #
|
||||
|
||||
17
index.php
17
index.php
@@ -43,6 +43,23 @@
|
||||
<input type="hidden" name="sure" value="yes" />
|
||||
</form>
|
||||
</div> <!-- /hide -->
|
||||
|
||||
<!-- ADDALIAS - Add a new email redirection -->
|
||||
<b class="switch"><span class="turn_on">»</span><span class="turn_off">«</span> Add an email redirection</b>
|
||||
<div class="hide">
|
||||
<p>This creates an alias email account. This account has no mailbox
|
||||
but just redirects all mails to another account.</p>
|
||||
<form action="submit.php" method="post">
|
||||
<label>Alias name:</label>
|
||||
<input name="user" title="Alias" />
|
||||
<label>Destination account:</label>
|
||||
<input name="pass" title="Destination" />
|
||||
<br />
|
||||
<button type="submit" name="action" value="addalias">Add alias</button>
|
||||
<!-- Hidden confirmation box -->
|
||||
<input type="hidden" name="sure" value="yes" />
|
||||
</form>
|
||||
</div> <!-- /hide -->
|
||||
|
||||
<!-- CHANGEPW - Change password of an email account -->
|
||||
<b class="switch"><span class="turn_on">»</span><span class="turn_off">«</span> Change email password</b>
|
||||
|
||||
Reference in New Issue
Block a user