Subversion Repositories ALCASAR

Compare Revisions

No changes between revisions

Ignore whitespace Rev 2895 → Rev 2896

/scripts/alcasar-test-debug-conup.sh
File deleted
Property changes:
Deleted: svn:eol-style
-native
\ No newline at end of property
Deleted: svn:executable
-*
\ No newline at end of property
/scripts/alcasar-condown.sh
52,7 → 52,7
ipset del $set_filter $FRAMED_IP_ADDRESS
ipset del $set_filterProto $FRAMED_IP_ADDRESS
 
# Remove IP address from active users
# Remove IP address from active users list
current_users_file="/tmp/current_users.txt"
[ -e $current_users_file ] && sed -i "/^$FRAMED_IP_ADDRESS:/d" $current_users_file
 
/scripts/script_test-create-mac-account-sh
0,0 → 1,71
#! /bin/bash
# script test&debug.sh
# by Rexy
# This script is distributed under the Gnu General Public License (GPL)
 
# This script tests the following behaviour :
# - Retreive 3 special attributes of a user ('test' by default). It Retrieves theses attributes from default group, then from user's group, then from its account
# - test if the attribute "Alcasar-Status-Page-Must-Stay-Open" is set to "2", then retrieve the "expiration" attribute
# - if the "expiration" attribute exists then create a new user (login = user's @MAC) and duplicates all user's attributes
 
 
PASSWD_FILE="/root/ALCASAR-passwords.txt"
USER_NAME="test"
DB_USER=`cat $PASSWD_FILE|grep ^db_user=|cut -d'=' -f2`
DB_PASSWORD=`cat $PASSWD_FILE|grep ^db_password=|cut -d'=' -f2`
 
# Retrieve 3 ALCASAR special radius attributes (search order : default group, then user's group, then user)
db_query="SELECT attribute, value FROM ( \
( SELECT attribute, value FROM radreply WHERE username = '$USER_NAME' AND (attribute IN ('Alcasar-Filter', 'Alcasar-Protocols-Filter', 'Alcasar-Status-Page-Must-Stay-Open')) ) UNION \
( SELECT attribute, value FROM radgroupreply gr LEFT JOIN radusergroup ug ON gr.groupname = ug.groupname WHERE username = '$USER_NAME' AND (attribute IN ('Alcasar-Filter', 'Alcasar-Protocols-Filter', 'Alcasar-Status-Page-Must-Stay-Open')) ORDER BY ug.priority ) UNION \
( SELECT attribute, value FROM radgroupreply WHERE groupname = 'default' AND (attribute IN ('Alcasar-Filter', 'Alcasar-Protocols-Filter', 'Alcasar-Status-Page-Must-Stay-Open')) ) \
) attrs GROUP BY attribute;"
db_radreply_res=$(mysql -u$DB_USER -p$DB_PASSWORD -D radius -e "$db_query" -Ns)
 
filter=$(echo "$db_radreply_res" | awk '$1 == "Alcasar-Filter" { print $2 }')
filterProto=$(echo "$db_radreply_res" | awk '$1 == "Alcasar-Protocols-Filter" { print $2 }')
statusOpenRequired=$(echo "$db_radreply_res" | awk '$1 == "Alcasar-Status-Page-Must-Stay-Open" { print $2 }')
echo "USER_NAME = $USER_NAME; filter = $filter; filterproto = $filterProto; statusOpenRequired = $statusOpenRequired";
 
# If status page isn't required :
# -add user_IP with the flag 'PERM' in /tmp/current_users.txt
# -add user_@MAC as an authenticated (with the same user's attributes)
if [ "$statusOpenRequired" == '2' ]; then # Status page is not required
echo ""
# Retrieve "expiration" attribute from radcheck
db_query="SELECT attribute, value FROM ( \
( SELECT attribute, value FROM radcheck WHERE username = '$USER_NAME' AND attribute = 'Expiration' ) UNION \
( SELECT attribute, value FROM radgroupcheck gr LEFT JOIN radusergroup ug ON gr.groupname = ug.groupname WHERE username = '$USER_NAME' AND attribute = 'Expiration' ORDER BY ug.priority ) UNION \
( SELECT attribute, value FROM radgroupcheck WHERE groupname = 'default' AND attribute = 'Expiration' ) \
) attrs GROUP BY attribute;"
db_radcheck_expiration_res=$(mysql -u$DB_USER -p$DB_PASSWORD -D radius -e "$db_query" -Ns)
# if a expiration date exists we retrieve all radreply attributes
if [ `echo $db_radcheck_expiration_res|wc -l` == '1' ]; then
echo "###########################"
echo "## Attributs radreply"
db_query="SELECT attribute, value FROM ( \
( SELECT attribute, value FROM radreply WHERE username = '$USER_NAME' ) UNION \
( SELECT attribute, value FROM radgroupreply gr LEFT JOIN radusergroup ug ON gr.groupname = ug.groupname WHERE username = '$USER_NAME' ORDER BY ug.priority ) UNION \
( SELECT attribute, value FROM radgroupreply WHERE groupname = 'default' ) \
) attrs GROUP BY attribute;"
mysql -u root -p$(cat $PASSWD_FILE | grep ^db_root= | cut -d'=' -f2-) -D radius -e "$db_query" -Ns | while IFS= read -r loop
do
attr=`echo $loop|cut -d" " -f1`
attr_value=`echo $loop|cut -d" " -f2-`
echo "$attr = $attr_value"
done
# if a expiration date exists we retrieve all radcheck attributes
echo "## Attributs radcheck"
db_query="SELECT attribute, value FROM ( \
( SELECT attribute, value FROM radcheck WHERE username = '$USER_NAME' ) UNION \
( SELECT attribute, value FROM radgroupcheck gr LEFT JOIN radusergroup ug ON gr.groupname = ug.groupname WHERE username = '$USER_NAME' ORDER BY ug.priority ) UNION \
( SELECT attribute, value FROM radgroupcheck WHERE groupname = 'default' ) \
) attrs GROUP BY attribute;"
mysql -u root -p$(cat $PASSWD_FILE | grep ^db_root= | cut -d'=' -f2-) -D radius -e "$db_query" -Ns | while IFS= read -r loop
do
attr=`echo $loop|cut -d" " -f1`
attr_value=`echo $loop|cut -d" " -f2-`
echo "$attr = $attr_value"
done
fi
fi
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/web/acc/manager/htdocs/group_new.php
5,13 → 5,13
if (is_file("../lib/langues.php"))
include("../lib/langues.php");
 
// Update Alcasar-Status-Page-Must-Stay-Open
if ((isset($_POST['Alcasar-Status-Page-Must-Stay-Open'])) && ($_POST['Alcasar-Status-Page-Must-Stay-Open'] === '2')) {
$_POST['Idle-Timeout'] = '600'; // 10 minutes
} else {
$_POST['Idle-Timeout'] = '';
}
$_POST['Idle-Timeout_op'] = '=';
// Update Alcasar-Status-Page-Must-Stay-Open --> TO TEST (Idle-Timeout)
//if ((isset($_POST['Alcasar-Status-Page-Must-Stay-Open'])) && ($_POST['Alcasar-Status-Page-Must-Stay-Open'] === '2')) {
// $_POST['Idle-Timeout'] = '600'; // 10 minutes
//} else {
// $_POST['Idle-Timeout'] = '';
//}
//$_POST['Idle-Timeout_op'] = '=';
 
require('/etc/freeradius-web/config.php');
 
476,8 → 476,8
case 'Alcasar-Status-Page-Must-Stay-Open' :
echo "<select name=\"$name\">";
echo "<option value=\"\"></option>";
echo "<option value=\"1\">$l_yes</option>";
echo "<option value=\"2\">$l_no</option>";
echo "<option value=\"1\">$l_no</option>";
echo "<option value=\"2\">$l_yes</option>";
echo "</select>";
break;
case 'Login-Time':
/web/acc/manager/htdocs/help/statusOpenRequired_help.html
13,15 → 13,13
</TABLE>
<TABLE width="100%" border=1 cellspacing=0 cellpadding=1>
<tr><td valign="middle" align="left">
Cet attribut définit si l'utilisateur doit garder sa "page status" ouverte pour rester connecté.<br>
Dans le cas contraire, ALCASAR le deconnectera automatiquement quand l'activité réseau de sa machine aura totalement disparue.<br>
Il est conseillé de désactiver cet attribut pour les utilisateurs exploitant un GSM ou une tablette.<br>
Rappel : L'utilisateur peut toujours se déconnecter en entrant "logout" dans la barre URL de son navigateur.
Autorise les équipements de l'utilisateur à resté connecté même si la fenêtre de status est fermée.<br>
Ces autorisations sont fermées automatiquement à minuit<br>
Rappel : L'utilisateur peut toujours se déconnecter en entrant "http://logout" dans la barre URL de son navigateur.
<HR>
This attribute defines whether the user must let its "status page" open to stay connected.<br>
In the opposite case, ALCASAR will disconnect him when the network activity of its PC will totally stop<br>
It's advisable to disable this attibute for users owning a mobile or a tablet.<br>
Reminder : The user can still disconnect himself by enter "logout" in the URL field of its web browser.
Allows the user's devices to remain logged even if the status windows is closed.<br>
These authorisations are automatically closed at midnight<br>
Reminder : The user can always log out by entering "http://logout" in the URL bar of their web browser.
</td></tr>
</table>
<br>
/web/acc/manager/htdocs/user_edit.php
6,12 → 6,12
include("../lib/langues.php");
 
// Update Alcasar-Status-Page-Must-Stay-Open --> TO TEST (Idle-Timeout)
if ((isset($_POST['Alcasar-Status-Page-Must-Stay-Open0'])) && ($_POST['Alcasar-Status-Page-Must-Stay-Open0'] === '2')) {
$_POST['Idle-Timeout0'] = '600'; // 10 minutes
} else {
$_POST['Idle-Timeout0'] = '';
}
$_POST['Idle-Timeout0_op'] = '=';
//if ((isset($_POST['Alcasar-Status-Page-Must-Stay-Open'])) && ($_POST['Alcasar-Status-Page-Must-Stay-Open'] === '2')) {
// $_POST['Idle-Timeout'] = '600'; // 10 minutes
//} else {
// $_POST['Idle-Timeout'] = '';
//}
//$_POST['Idle-Timeout_op'] = '=';
 
require('/etc/freeradius-web/config.php');
require('../lib/attrshow.php');
337,9 → 337,9
break;
case 'Alcasar-Status-Page-Must-Stay-Open' :
if ($val === '2') {
$grp_statusOpenRequired = $l_yes;
} else if ($val === '1') {
$grp_statusOpenRequired = $l_no;
} else if ($val === '1') {
$grp_statusOpenRequired = $l_yes;
} else {
$grp_statusOpenRequired = '';
}
797,8 → 797,8
case 'Alcasar-Status-Page-Must-Stay-Open' :
echo "<select name=\"$name1\">";
echo "<option value=\"\"".(($val === '') ? ' selected' : '')."></option>";
echo "<option value=\"1\"".(($val === '1') ? ' selected' : '').">$l_yes</option>";
echo "<option value=\"2\"".(($val === '2') ? ' selected' : '').">$l_no</option>";
echo "<option value=\"1\"".(($val === '1') ? ' selected' : '').">$l_no</option>";
echo "<option value=\"2\"".(($val === '2') ? ' selected' : '').">$l_yes</option>";
echo "</select>";
break;
case 'Login-Time':
/web/acc/manager/htdocs/user_new.php
5,13 → 5,13
if (is_file("../lib/langues.php"))
include("../lib/langues.php");
 
// Update Alcasar-Status-Page-Must-Stay-Open
if ((isset($_POST['Alcasar-Status-Page-Must-Stay-Open'])) && ($_POST['Alcasar-Status-Page-Must-Stay-Open'] === '2')) {
$_POST['Idle-Timeout'] = '600'; // 10 minutes
} else {
$_POST['Idle-Timeout'] = '';
}
$_POST['Idle-Timeout_op'] = '=';
// Update Alcasar-Status-Page-Must-Stay-Open --> TO TEST (Idle-Timeout)
//if ((isset($_POST['Alcasar-Status-Page-Must-Stay-Open'])) && ($_POST['Alcasar-Status-Page-Must-Stay-Open'] === '2')) {
// $_POST['Idle-Timeout'] = '600'; // 10 minutes
//} else {
// $_POST['Idle-Timeout'] = '';
//}
//$_POST['Idle-Timeout_op'] = '=';
 
require('/etc/freeradius-web/config.php');
 
480,8 → 480,8
case 'Alcasar-Status-Page-Must-Stay-Open' :
echo "<select name=\"$name\">";
echo "<option value=\"\"></option>";
echo "<option value=\"1\">$l_yes</option>";
echo "<option value=\"2\">$l_no</option>";
echo "<option value=\"1\">$l_no</option>";
echo "<option value=\"2\">$l_yes</option>";
echo "</select>";
break;
case 'Login-Time':
/web/acc/manager/lib/langues.php
1,15 → 1,11
<?php
 
//Fichier de gestion des langues
// Choix de la langue
// Language choice
$Language = 'en';
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
$Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
$Language = strtolower(substr(chop($Langue[0]),0,2)); }
// En fonction de la langue et de la page d'appel remplissage des variables
switch ($Language){
case 'fr':
//Français
$l_monday="lundi"; $l_tuesday="mardi"; $l_wednesday="mercredi"; $l_thursday="jeudi"; $l_friday="vendredi"; $l_saturday="samedi"; $l_sunday="dimanche";
$l_monthly="mensuelle";$l_weekly="hebdomadaire";$l_daily="journalière";$l_by_session="par session";
$l_day = "Jour";
130,17 → 126,141
$l_empty="Vide";
$l_ipAddress="Adresse IP";
$l_rule="Règle";
$l_statusOpenRequired="La page de statut doit restée ouverte";
$l_statusOpenRequired="Autoriser ses équipements";
$l_yes="Oui";
$l_no="Non";
break;
case 'es':
$l_monday="monday"; $l_tuesday="tuesday"; $l_wednesday="wednesday"; $l_thursday="thursday"; $l_friday="friday"; $l_saturday="saturday"; $l_sunday="sunday";
$l_monthly="monthly";$l_weekly="weekly";$l_daily="daily";$l_by_session="by session";
$l_day = "Day";
$l_limit = "limit";
$l_daily_limit="daily limit";
$l_used_time = "Used time";
$l_last7days_status = "Last 7 days status";
$l_already_exist = "already exist";
$l_connections_number = "Connections number";
$l_download = "Downloaded data";
$l_upload = "Uploaded data";
$l_average = "average";
$l_user = "User";
$l_users_managment = "Users managment";
$l_groups_managment = "Groups managment";
$l_search_filter = "Search filter";
$l_search_criteria = "Search criteria";
$l_search = "Start search";
$l_no_user_found = "No user found";
$l_special_attribute = "Special attribute";
$l_attribute = "Attribute";
$l_value = "Value<br>(empty = all)";
$l_login = "Login";
$l_password = "Password";
$l_new_password = "New password";
$l_passwd_gen = "generate";
$l_user_create = "Create a user";
$l_nb_users = "Number of users";
$l_group_create = "Create a group";
$l_group_select = "Select a group";
$l_group = "Group";
$l_created_groups = "Already created group(s)";
$l_group_name = "Group name";
$l_group_members = "Members of group :<br>(separate by a 'space' or a 'carriage return')";
$l_group_members_remove = "Remove all members of this group";
$l_group_members_to_remove = "<b>Members to remove :</b><br>The selected members will be remove from the group.<br>Use 'shift' or 'Ctrl' for multiple selection.";
$l_group_members_to_add = "<b>Members to add :</b><br>Separate the members with a 'space' or a 'carriage return'.";
$l_manage_selected_user= "Manage the selected user";
$l_group_member = "Member of group";
$l_group_empty = "The group list is empty";
$l_main_group = "The current user group is highlighted in blue";
$l_no_group = "No group";
$l_no_open_session = "No open session";
$l_opened_sessions = "opened session(s)";
$l_active_accounting = "active accounting(s)";
$l_want_to_close ="Do you want to close them ?";
$l_yes_close ="Yes, close";
$l_status ="STATUS";
$l_personal_info ="PERSONAL INFORMATIONS";
$l_connections ="CONNECTIONS";
$l_open_sessions ="OPEN SESSIONS";
$l_members ="MEMBERS";
$l_attributes ="ATTRIBUTES";
$l_remove ="REMOVE";
$l_locked_user ="The user account is locked";
$l_user_remain_login ="The user can log in during ";
$l_user_expired ="The user account has expired";
$l_connected ="Connected from";
$l_connection_time ="Connection time";
$l_total_connections_time ="Total connections time";
$l_user_never_login ="This user has never logged in";
$l_user_not_login_yet ="This user isn't connected yet";
$l_last_login ="Last connection";
$l_remain_time ="Remain connection time";
$l_description ="Description";
$l_name = "Surname and name";
$l_email = "Email Address";
$l_homephone = "Personal phone number";
$l_telephonenumber = "Office phone number";
$l_mobile = "Mobile phone number";
$l_lang_ticket = "Voucher language";
$l_simultaneous_use = "Number of concurent login";
$l_max_all_session = "Maximum time of connection<br>(in seconds)";
$l_expire_after = "Authorized period after the first connection<br>(in seconds)";
$l_expiration = "Expiration date";
$l_session_timeout = "Maximum time for a session<br>(in seconds)";
$l_daily_timeout = "Maximum time of connection per day<br>(in seconds)";
$l_monthly_timeout = "Maximum time of connection per month<br>(in seconds)";
$l_login_time = "Weekly period";
$l_max_input_octets = "Maximum of data uploaded<br>(in octets)";
$l_max_output_octets = "Maximum of data downloaded<br>(in octets)";
$l_max_total_octets = "Maximum of data exchanged<br>(in octets)";
$l_max_total_octets_daily = "Maximum of data exchanged daily<br>(in octets)";
$l_max_total_octets_monthly = "Maximum of data exchanged monthly<br>(in octets)";
$l_max_bandwidth_up = "Maximum upload bandwidth<br>(in kbits/second)";
$l_max_bandwidth_down = "Maximum download bandwidth<br>(in kbits/second)";
$l_wispr_redirection = "Redirection URL";
$l_click_for_help = "Click to show help about this attribute";
$l_show_profile = "Show profile";
$l_are_you_sure = "Are you sure to remove";
$l_yes_remove = "Yes, remove";
$l_create = "Create";
$l_advanced_menu = "Advanced menu";
$l_simple_menu = "Simple menu";
$l_change = "Change";
$l_or = "Or";
$l_create_ticket = "Create a ticket (voucher)";
$l_create_multiple = "Create several tickets";
$l_create_multiple_comment = "<br>Note: when creating multiple tickets simultaneously :<br>
- username and password are randomly generated,<br>
- fields \"Surname and name\" and \"Email Address\" are not use.<br> ";
$l_createTicketsMSG = "Enter the number of users to create";
$l_filtering = "Antivirus & domain Filtering";
$l_filtering_none = "None";
$l_filtering_av = "WEB Antivirus";
$l_filtering_av_bl = "Blacklist + WEB antivirus";
$l_filtering_av_wl = "Whitelist + WEB antivirus";
$l_user_exists = "already exists !";
$l_created = "has been correctly created";
$l_removed = "has been removed";
$l_group_desc = "<h2>Group Attributes</h2>";
$l_user_desc = "<h2>User Attributes</h2>";
$l_proto="Network protocols filtering";
$l_proto_0="None";
$l_proto_1="Web browsing (HTTP & HTTPS)";
$l_proto_2="Web browsing + Mail + remote access";
$l_proto_3="Customized";
$l_empty="Empty";
$l_ipAddress="IP address";
$l_rule="Rule";
$l_statusOpenRequired="Authorise its equipment";
$l_yes="Yes";
$l_no="No";
break;
default :
//English
$l_monday="monday"; $l_tuesday="tuesday"; $l_wednesday="wednesday"; $l_thursday="thursday"; $l_friday="friday"; $l_saturday="saturday"; $l_sunday="sunday";
$l_monthly="monthly";$l_weekly="weekly";$l_daily="daily";$l_by_session="by session";
$l_day = "Day";
$l_limit = "limit";
$l_daily_limit="daily limit";
$l_daily_limit="daily limit";
$l_used_time = "Used time";
$l_last7days_status = "Last 7 days status";
$l_already_exist = "already exist";
256,7 → 376,7
$l_empty="Empty";
$l_ipAddress="IP address";
$l_rule="Rule";
$l_statusOpenRequired="Status page need to stay open";
$l_statusOpenRequired="Authorise its equipment";
$l_yes="Yes";
$l_no="No";
break;