/alcasar.sh |
---|
1010,11 → 1010,12 |
radius_web () |
{ |
# copie de l'interface d'origine dans la structure Alcasar |
[ -d /usr/share/freeradius-web ] && cp -rf /usr/share/freeradius-web/* $DIR_ACC/manager/ |
rm -f $DIR_ACC/manager/index.html $DIR_ACC/manager/readme |
rm -f $DIR_ACC/manager/htdocs/about.html $DIR_ACC/manager/htdocs/index.html $DIR_ACC/manager/htdocs/content.html |
#[ -d /usr/share/freeradius-web ] && cp -rf /usr/share/freeradius-web/* $DIR_ACC/manager/ |
#rm -f $DIR_ACC/manager/index.html $DIR_ACC/manager/readme |
#rm -f $DIR_ACC/manager/htdocs/about.html $DIR_ACC/manager/htdocs/index.html $DIR_ACC/manager/htdocs/content.html |
# copie des fichiers modifiés |
cp -rf $DIR_INSTALL/web/acc/manager/* $DIR_ACC/manager/ |
cp -rf $DIR_CONF/freeradius-web/ /etc/ |
chown -R apache:apache $DIR_ACC/manager/ |
# Modification des fichiers de configuration |
[ -e /etc/freeradius-web/admin.conf.default ] || cp /etc/freeradius-web/admin.conf /etc/freeradius-web/admin.conf.default |
/conf/freeradius-web/accounting.attrs |
---|
0,0 → 1,20 |
# Used by the User Accounting, the User finger and the Failed Logins page |
# |
# For the user finger page only callerid(9) and |
# ip address(4) are applicable |
# |
# For the Failed Logins page only looged in(2), server(7), |
# terminate cause(8) and callerid(9) are applicable |
# |
# attribute number Description Show in Show in Show in |
# User Accounting User Finger Failed Logins |
# |
1 type no no no |
2 logged in yes no yes |
3 session time yes no no |
4 ip address no yes no |
5 upload yes no no |
6 download yes no no |
7 server yes no yes |
8 terminate cause yes no yes |
9 callerid yes yes yes |
/conf/freeradius-web/admin.conf |
---|
0,0 → 1,351 |
# |
# Main Configuration File |
# |
# it can be default or whatever language. Only greek are supported |
# from non latin alphabet languages |
# These attribute only apply for ldap not for sql |
# |
general_prefered_lang: en |
general_prefered_lang_name: English |
# |
# The charset which will be added as a meta tag in all pages |
# |
general_charset: utf-8 |
# |
# Uncomment this if normal attributes (not the ;lang-xx ones) in ldap |
# are utf8 encoded. |
# |
#general_decode_normal_attributes: yes |
# |
# The directory where dialupadmin is installed |
# |
general_base_dir: /usr/share/freeradius-web |
# |
# The base directory of the freeradius radius installation |
# |
general_radiusd_base_dir: /usr |
general_domain: localdomain |
# |
# Set it to yes to use sessions and cache the various mappings |
# You can also set use_session = 1 in config.php to also cache |
# the admin.conf |
# |
# ---- IMPORTANT -- IMPORTANT -- IMPORTANT ---- |
#Remember to use the 'Clear Cache' page if you use sessions and do any changes |
#in any of the configuration files. |
# |
general_use_session: no |
# |
# This is used by the failed logins page. It states the default back time |
# in minutes. |
# |
general_most_recent_fl: 30 |
# |
# Realm setup |
# |
# Set general_strip_realms to yes in order to stip realms from usernames. |
# By default realms are not striped |
#general_strip_realms: yes |
# |
# The delimiter used in realms. Default is @ |
# |
general_realm_delimiter: @ |
# |
# The format of the realms. Can be either suffix (realm is after the username) |
# or prefix (realm is before the username). Default is suffix |
# |
general_realm_format: suffix |
# |
# |
# Determines if the administrator will be able to see and change the user password through |
# the user edit page |
general_show_user_password: yes |
general_raddb_dir: /etc/raddb |
general_ldap_attrmap: %{general_raddb_dir}/ldap.attrmap |
# Need to fix admin.conf file parser |
#general_clients_conf: %{general_raddb_dir}/clients.conf |
general_clients_conf: /etc/raddb/clients.conf |
general_sql_attrmap: /etc/freeradius-web/sql.attrmap |
general_accounting_attrs_file: /etc/freeradius-web/accounting.attrs |
general_extra_ldap_attrmap: /etc/freeradius-web/extra.ldap-attrmap |
general_username_mappings_file: /etc/freeradius-web/username.mappings |
# |
# it can be either ldap or sql |
# This affects the user base not accounting. Accounting is always in sql |
# |
general_lib_type: sql |
# |
# Define which attributes will be visible in the user edit page |
# |
general_user_edit_attrs_file: /etc/freeradius-web/user_edit.attrs |
# |
# Used by the Accounting Report Generator |
# |
general_sql_attrs_file: /etc/freeradius-web/sql.attrs |
# |
# Set default values for various attributes |
# |
general_default_file: /etc/freeradius-web/default.vals |
#general_ld_library_path: /usr/local/snmpd/lib |
# |
# can be 'snmp' (for snmpfinger) or empty to query the radacct table without first |
# querying the nas |
# This is used by the online users page |
# |
# general_finger_type: snmp |
# |
# Defines the nas type. This is only used by snmpfinger |
# cisco, usrhiper and lucent are supported for now |
# |
general_nas_type: cisco |
general_snmpfinger_bin: %{general_base_dir}/bin/snmpfinger |
# |
# Used by the 'Disconnect User' button in the Clear Open Sessions page |
# Uses the Cisco AAA Session MIB or a telnet session |
# |
general_sessionclear_bin: %{general_base_dir}/bin/clearsession |
# |
# Can be one of telnet or snmp |
# |
general_sessionclear_method: snmp |
general_radclient_bin: %{general_radiusd_base_dir}/bin/radclient |
# |
# this information is used from the server check page |
# |
general_test_account_login: test |
general_test_account_password: testpass |
# |
# These are used as default values for the user test page |
# |
general_radius_server: localhost |
general_radius_server_port: 1812 |
# |
# can be either pap or chap |
# |
general_radius_server_auth_proto: pap |
# |
# sorry, single valued for now. Should become something like |
# password[server-name]: xxxxx |
# |
general_radius_server_secret: XXXXXX |
general_auth_request_file: /etc/freeradius-web/auth.request |
# |
# can be one of crypt,md5,clear |
# |
general_encryption_method: crypt |
# |
# can be either asc (older dates first) or desc (recent dates first) |
# This is used in the user accounting and badusers pages |
# |
general_accounting_info_order: desc |
# |
# Use the totacct table in the user statistics page instead of the radacct |
# table. That will make the page run quicker. totacct should have data for |
# this to work :-) |
# |
general_stats_use_totacct: yes |
# |
# If set to yes then we only allow each administrator to examine it's own entries |
# in the badusers table |
# |
general_restrict_badusers_access: no |
# |
# If set to yes then we restrict access to the nas administration page only to those |
# users which are allowed by their username mapping (nasadmin is set to yes) |
# |
general_restrict_nasadmin_access: no |
INCLUDE: /etc/freeradius-web/naslist.conf |
INCLUDE: /etc/freeradius-web/captions.conf |
# |
# The ldap server to connect to. |
# Both ldap_server and ldap_write_server can be a space-separated |
# list of ldap hostnames. In that case the library will try to connect |
# to the servers in the order that they appear. If the first host is down |
# ldap_connect will ask for the second ldap host and so on. |
# |
ldap_server: ldap.%{general_domain} |
# |
# There are many cases where we have a small write master and |
# a lot of fast read only replicas. If that is the case uncomment |
# ldap_write_server and point it to the write master. It will be |
# used only when writing to the directory, not when reading |
# |
#ldap_write_server: master.%{general_domain} |
ldap_base: dc=company,dc=com |
ldap_binddn: cn=Directory Manager |
ldap_bindpw: XXXXXXX |
ldap_default_new_entry_suffix: ou=dialup,ou=guests,%{ldap_base} |
ldap_default_dn: uid=default-dialup,%{ldap_base} |
ldap_regular_profile_attr: dialupregularprofile |
# |
# If set to yes then the HTTP credentials (http authentication) |
# will be used to bind to the ldap server instead of ldap_binddn |
# and ldap_bindpw. That way multiple admins with different rights |
# on the ldap database can connect through one dialup_admin interface. |
# The ldap_binddn and ldap_bindpw are still needed to find the DN |
# to bind with (http authentication will only provide us with a |
# username). As a result the ldap_binddn should be able to do a search |
# with a filter of (uid=<username>). Normally, the anonymous (empty DN) |
# user can do that. |
#ldap_use_http_credentials: yes |
# |
# If we are using http credentials we can map a specific username to the |
# directory manager (which usually does not correspond to a specific username) |
# |
#ldap_directory_manager: cn=Directory Manager |
#ldap_map_to_directory_manager: admin |
# |
# Uncomment to enable ldap debug |
# |
ldap_debug: true |
# |
# Allow for defining the ldap filter used when searching for a user |
# Variables supported: |
# %u: username |
# %U: username provided though http authentication |
# %mu: mappings for userdb |
# %ma: mappings for accounting |
# %mn: mappings for nasdb |
# %mN: mappings for nas administration |
# |
# One use of this would be to restrict access to only the user's belonging to |
# a specific administrator like this: |
# ldap_filter: (&(uid=%u)(manager=uid=%U,ou=admins,o=company,c=com)) |
# |
#ldap_filter: (uid=%u) |
# |
# If ldap_userdn is set then we use that for user dns, we don't perform an ldap |
# search. This can be somewhat faster. The variables supported for ldap_filter |
# are also supported here |
# |
#ldap_userdn: uid=%u,%{ldap_base} |
# |
# can be one of mysql,pg,oracle,sqlrelay where: |
# mysq: MySQL database (port 3306) |
# pg: PostgreSQL database (port 5432) |
# oracle: Oracle database (port 1521) |
# sqlrelay: SQL Relay |
# |
sql_type: mysql |
sql_server: localhost |
sql_port: 3306 |
sql_username: radius |
sql_password: KS3ShPIP |
sql_database: radius |
sql_accounting_table: radacct |
sql_badusers_table: badusers |
sql_check_table: radcheck |
sql_reply_table: radreply |
sql_user_info_table: userinfo |
sql_groupcheck_table: radgroupcheck |
sql_groupreply_table: radgroupreply |
sql_usergroup_table: radusergroup |
sql_total_accounting_table: totacct |
sql_nas_table: nas |
# |
# If set to true then we show all the available groups with the groups |
# that the user is a member of highlighted in the user edit page. |
# Otherwise we only show the groups he is a member of. |
sql_show_all_groups: true |
# |
# This variable is used by the scripts in the bin folder |
# It should contain the path to the sql binary used to run |
# sql commands (mysql, psql, oracle and sqlrelay are only supported for now) |
sql_command: /usr/bin/mysql |
#sql_command: /usr/bin/psql |
#sql_command: /usr/bin/sqlplus |
# |
# This variable is used by the scripts in the bin folder |
# It should contain the snmp type and path to the binary |
# used to run snmp commands. |
# (ucd = UCD-Snmp and net = Net-Snmp are only supported for now) |
general_snmp_type: net |
general_snmpwalk_command: /usr/bin/snmpwalk |
general_snmpget_command: /usr/bin/snmpget |
# |
# Uncomment to enable sql debug |
# |
sql_debug: false |
# |
# If set to yes then the HTTP credentials (http authentication) |
# will be used to connect to the sql server instead of sql_username |
# and sql_password. That way multiple admins with different rights |
# on the sql database can connect through one dialup_admin interface. |
#sql_use_http_credentials: yes |
# |
# If set the query will be added to all of the queries on the accounting |
# table |
# Variables supported: |
# %u: username |
# %U: username provided though http authentication |
# %mu: mappings for userdb |
# %ma: mappings for accounting |
# %mn: mappings for nasdb |
# %mN: mappings for nas administration |
#sql_accounting_extra_query: %ma |
# |
# true or false |
# |
sql_use_user_info_table: true |
sql_use_operators: true |
# |
# Set this to the value of the default_user_profile in your |
# sql.conf if that one is set. If it is not set leave blank |
# or commented out |
#sql_default_user_profile: DEFAULT |
# |
# |
sql_password_attribute: Crypt-Password |
sql_date_format: Y-m-d |
sql_full_date_format: Y-m-d H:i:s |
# |
# Used in the accounting report generator so that we |
# don't return too many results |
# |
sql_row_limit: 40 |
# |
# These options are used by the log_badlogins script and by the |
# mysql driver |
# |
# Set the sql connect timeout (secs) |
sql_connect_timeout: 3 |
# Give a space separated list of extra mysql servers to connect to when |
# logging bad logins or adding users in the badusers table |
#sql_extra_servers: sql2.company.com sql3.company.com |
# |
# Default values for the various user limits in case the counter module |
# is used to impose such limits. |
# The value should be the user limit in seconds or none for nothing |
# Check out conf/sql.attrmap or extra.ldap-attrmap (depending on if you are |
# using sql or ldap) for per user attributes. The mapping should be made to |
# the attributes configured in the counter module. The attributes used by |
# dialupadmin will always be the ones appearing in the attribute mapping files |
# so you should make sure they are mapped to the correct attributes |
# |
#counter_default_daily: 14400 |
#counter_default_weekly: 72000 |
counter_default_daily: none |
counter_default_weekly: none |
counter_default_monthly: none |
# |
# Since calculating monthly usage can be quite expensive we make |
# it configurable |
# This is not needed if the monthly limit is not none |
#counter_monthly_calculate_usage: true |
# some of the date/time related functions need to know what timezone we are in |
timezone: Europe/Luxembourg |
/conf/freeradius-web/admin.conf.default |
---|
0,0 → 1,351 |
# |
# Main Configuration File |
# |
# it can be default or whatever language. Only greek are supported |
# from non latin alphabet languages |
# These attribute only apply for ldap not for sql |
# |
general_prefered_lang: en |
general_prefered_lang_name: English |
# |
# The charset which will be added as a meta tag in all pages |
# |
general_charset: iso-8859-1 |
# |
# Uncomment this if normal attributes (not the ;lang-xx ones) in ldap |
# are utf8 encoded. |
# |
#general_decode_normal_attributes: yes |
# |
# The directory where dialupadmin is installed |
# |
general_base_dir: /usr/share/freeradius-web |
# |
# The base directory of the freeradius radius installation |
# |
general_radiusd_base_dir: /usr |
general_domain: company.com |
# |
# Set it to yes to use sessions and cache the various mappings |
# You can also set use_session = 1 in config.php to also cache |
# the admin.conf |
# |
# ---- IMPORTANT -- IMPORTANT -- IMPORTANT ---- |
#Remember to use the 'Clear Cache' page if you use sessions and do any changes |
#in any of the configuration files. |
# |
general_use_session: no |
# |
# This is used by the failed logins page. It states the default back time |
# in minutes. |
# |
general_most_recent_fl: 30 |
# |
# Realm setup |
# |
# Set general_strip_realms to yes in order to stip realms from usernames. |
# By default realms are not striped |
#general_strip_realms: yes |
# |
# The delimiter used in realms. Default is @ |
# |
general_realm_delimiter: @ |
# |
# The format of the realms. Can be either suffix (realm is after the username) |
# or prefix (realm is before the username). Default is suffix |
# |
general_realm_format: suffix |
# |
# |
# Determines if the administrator will be able to see and change the user password through |
# the user edit page |
general_show_user_password: yes |
general_raddb_dir: /etc/raddb |
general_ldap_attrmap: %{general_raddb_dir}/ldap.attrmap |
# Need to fix admin.conf file parser |
#general_clients_conf: %{general_raddb_dir}/clients.conf |
general_clients_conf: /etc/raddb/clients.conf |
general_sql_attrmap: /etc/freeradius-web/sql.attrmap |
general_accounting_attrs_file: /etc/freeradius-web/accounting.attrs |
general_extra_ldap_attrmap: /etc/freeradius-web/extra.ldap-attrmap |
general_username_mappings_file: /etc/freeradius-web/username.mappings |
# |
# it can be either ldap or sql |
# This affects the user base not accounting. Accounting is always in sql |
# |
general_lib_type: sql |
# |
# Define which attributes will be visible in the user edit page |
# |
general_user_edit_attrs_file: /etc/freeradius-web/user_edit.attrs |
# |
# Used by the Accounting Report Generator |
# |
general_sql_attrs_file: /etc/freeradius-web/sql.attrs |
# |
# Set default values for various attributes |
# |
general_default_file: /etc/freeradius-web/default.vals |
#general_ld_library_path: /usr/local/snmpd/lib |
# |
# can be 'snmp' (for snmpfinger) or empty to query the radacct table without first |
# querying the nas |
# This is used by the online users page |
# |
general_finger_type: snmp |
# |
# Defines the nas type. This is only used by snmpfinger |
# cisco, usrhiper and lucent are supported for now |
# |
general_nas_type: cisco |
general_snmpfinger_bin: %{general_base_dir}/bin/snmpfinger |
# |
# Used by the 'Disconnect User' button in the Clear Open Sessions page |
# Uses the Cisco AAA Session MIB or a telnet session |
# |
general_sessionclear_bin: %{general_base_dir}/bin/clearsession |
# |
# Can be one of telnet or snmp |
# |
general_sessionclear_method: snmp |
general_radclient_bin: %{general_radiusd_base_dir}/bin/radclient |
# |
# this information is used from the server check page |
# |
general_test_account_login: test |
general_test_account_password: testpass |
# |
# These are used as default values for the user test page |
# |
general_radius_server: localhost |
general_radius_server_port: 1812 |
# |
# can be either pap or chap |
# |
general_radius_server_auth_proto: pap |
# |
# sorry, single valued for now. Should become something like |
# password[server-name]: xxxxx |
# |
general_radius_server_secret: XXXXXX |
general_auth_request_file: /etc/freeradius-web/auth.request |
# |
# can be one of crypt,md5,clear |
# |
general_encryption_method: crypt |
# |
# can be either asc (older dates first) or desc (recent dates first) |
# This is used in the user accounting and badusers pages |
# |
general_accounting_info_order: desc |
# |
# Use the totacct table in the user statistics page instead of the radacct |
# table. That will make the page run quicker. totacct should have data for |
# this to work :-) |
# |
general_stats_use_totacct: no |
# |
# If set to yes then we only allow each administrator to examine it's own entries |
# in the badusers table |
# |
general_restrict_badusers_access: no |
# |
# If set to yes then we restrict access to the nas administration page only to those |
# users which are allowed by their username mapping (nasadmin is set to yes) |
# |
general_restrict_nasadmin_access: no |
INCLUDE: /etc/freeradius-web/naslist.conf |
INCLUDE: /etc/freeradius-web/captions.conf |
# |
# The ldap server to connect to. |
# Both ldap_server and ldap_write_server can be a space-separated |
# list of ldap hostnames. In that case the library will try to connect |
# to the servers in the order that they appear. If the first host is down |
# ldap_connect will ask for the second ldap host and so on. |
# |
ldap_server: ldap.%{general_domain} |
# |
# There are many cases where we have a small write master and |
# a lot of fast read only replicas. If that is the case uncomment |
# ldap_write_server and point it to the write master. It will be |
# used only when writing to the directory, not when reading |
# |
#ldap_write_server: master.%{general_domain} |
ldap_base: dc=company,dc=com |
ldap_binddn: cn=Directory Manager |
ldap_bindpw: XXXXXXX |
ldap_default_new_entry_suffix: ou=dialup,ou=guests,%{ldap_base} |
ldap_default_dn: uid=default-dialup,%{ldap_base} |
ldap_regular_profile_attr: dialupregularprofile |
# |
# If set to yes then the HTTP credentials (http authentication) |
# will be used to bind to the ldap server instead of ldap_binddn |
# and ldap_bindpw. That way multiple admins with different rights |
# on the ldap database can connect through one dialup_admin interface. |
# The ldap_binddn and ldap_bindpw are still needed to find the DN |
# to bind with (http authentication will only provide us with a |
# username). As a result the ldap_binddn should be able to do a search |
# with a filter of (uid=<username>). Normally, the anonymous (empty DN) |
# user can do that. |
#ldap_use_http_credentials: yes |
# |
# If we are using http credentials we can map a specific username to the |
# directory manager (which usually does not correspond to a specific username) |
# |
#ldap_directory_manager: cn=Directory Manager |
#ldap_map_to_directory_manager: admin |
# |
# Uncomment to enable ldap debug |
# |
ldap_debug: true |
# |
# Allow for defining the ldap filter used when searching for a user |
# Variables supported: |
# %u: username |
# %U: username provided though http authentication |
# %mu: mappings for userdb |
# %ma: mappings for accounting |
# %mn: mappings for nasdb |
# %mN: mappings for nas administration |
# |
# One use of this would be to restrict access to only the user's belonging to |
# a specific administrator like this: |
# ldap_filter: (&(uid=%u)(manager=uid=%U,ou=admins,o=company,c=com)) |
# |
#ldap_filter: (uid=%u) |
# |
# If ldap_userdn is set then we use that for user dns, we don't perform an ldap |
# search. This can be somewhat faster. The variables supported for ldap_filter |
# are also supported here |
# |
#ldap_userdn: uid=%u,%{ldap_base} |
# |
# can be one of mysql,pg,oracle,sqlrelay where: |
# mysq: MySQL database (port 3306) |
# pg: PostgreSQL database (port 5432) |
# oracle: Oracle database (port 1521) |
# sqlrelay: SQL Relay |
# |
sql_type: mysql |
sql_server: localhost |
sql_port: 3306 |
sql_username: dialup_admin |
sql_password: XXXXXX |
sql_database: radius |
sql_accounting_table: radacct |
sql_badusers_table: badusers |
sql_check_table: radcheck |
sql_reply_table: radreply |
sql_user_info_table: userinfo |
sql_groupcheck_table: radgroupcheck |
sql_groupreply_table: radgroupreply |
sql_usergroup_table: radusergroup |
sql_total_accounting_table: totacct |
sql_nas_table: nas |
# |
# If set to true then we show all the available groups with the groups |
# that the user is a member of highlighted in the user edit page. |
# Otherwise we only show the groups he is a member of. |
sql_show_all_groups: true |
# |
# This variable is used by the scripts in the bin folder |
# It should contain the path to the sql binary used to run |
# sql commands (mysql, psql, oracle and sqlrelay are only supported for now) |
sql_command: /usr/bin/mysql |
#sql_command: /usr/bin/psql |
#sql_command: /usr/bin/sqlplus |
# |
# This variable is used by the scripts in the bin folder |
# It should contain the snmp type and path to the binary |
# used to run snmp commands. |
# (ucd = UCD-Snmp and net = Net-Snmp are only supported for now) |
general_snmp_type: net |
general_snmpwalk_command: /usr/bin/snmpwalk |
general_snmpget_command: /usr/bin/snmpget |
# |
# Uncomment to enable sql debug |
# |
sql_debug: true |
# |
# If set to yes then the HTTP credentials (http authentication) |
# will be used to connect to the sql server instead of sql_username |
# and sql_password. That way multiple admins with different rights |
# on the sql database can connect through one dialup_admin interface. |
#sql_use_http_credentials: yes |
# |
# If set the query will be added to all of the queries on the accounting |
# table |
# Variables supported: |
# %u: username |
# %U: username provided though http authentication |
# %mu: mappings for userdb |
# %ma: mappings for accounting |
# %mn: mappings for nasdb |
# %mN: mappings for nas administration |
#sql_accounting_extra_query: %ma |
# |
# true or false |
# |
sql_use_user_info_table: true |
sql_use_operators: true |
# |
# Set this to the value of the default_user_profile in your |
# sql.conf if that one is set. If it is not set leave blank |
# or commented out |
#sql_default_user_profile: DEFAULT |
# |
# |
sql_password_attribute: User-Password |
sql_date_format: Y-m-d |
sql_full_date_format: Y-m-d H:i:s |
# |
# Used in the accounting report generator so that we |
# don't return too many results |
# |
sql_row_limit: 40 |
# |
# These options are used by the log_badlogins script and by the |
# mysql driver |
# |
# Set the sql connect timeout (secs) |
sql_connect_timeout: 3 |
# Give a space separated list of extra mysql servers to connect to when |
# logging bad logins or adding users in the badusers table |
#sql_extra_servers: sql2.company.com sql3.company.com |
# |
# Default values for the various user limits in case the counter module |
# is used to impose such limits. |
# The value should be the user limit in seconds or none for nothing |
# Check out conf/sql.attrmap or extra.ldap-attrmap (depending on if you are |
# using sql or ldap) for per user attributes. The mapping should be made to |
# the attributes configured in the counter module. The attributes used by |
# dialupadmin will always be the ones appearing in the attribute mapping files |
# so you should make sure they are mapped to the correct attributes |
# |
#counter_default_daily: 14400 |
#counter_default_weekly: 72000 |
counter_default_daily: none |
counter_default_weekly: none |
counter_default_monthly: none |
# |
# Since calculating monthly usage can be quite expensive we make |
# it configurable |
# This is not needed if the monthly limit is not none |
#counter_monthly_calculate_usage: true |
# some of the date/time related functions need to know what timezone we are in |
timezone: Europe/Luxembourg |
/conf/freeradius-web/auth.request |
---|
0,0 → 1,5 |
# |
# Extra attributes that the test user/check server pages will send to |
# the RADIUS server |
# |
Service-Type = Framed-User |
/conf/freeradius-web/captions.conf |
---|
0,0 → 1,0 |
general_caption_finger_free_lines: free lines |
/conf/freeradius-web/config.php |
---|
0,0 → 1,123 |
<?php |
# |
# Things should work even if register_globals is set to off |
# |
$testVer=intval(str_replace(".", "",'4.1.0')); |
$curVer=intval(str_replace(".", "",phpversion())); |
if( $curVer >= $testVer ) |
{ |
// import_request_variables('GPC'); |
extract($_GET); |
extract($_POST); |
extract($_COOKIE); |
} |
foreach($_POST as $key => $value){ |
${$key} = $value; |
} |
# If using sessions set use_session to 1 to also cache the config file |
# |
$use_session = 0; |
unset($config); |
unset($nas_list); |
if ($use_session){ |
// Start session |
@session_start(); |
if (isset($_SESSION['config'])) |
$config = $_SESSION['config']; |
if (isset($_SESSION['nas_list'])) |
$nas_list = $_SESSION['nas_list']; |
} |
if (!isset($config)){ |
$ARR=file("/etc/freeradius-web/admin.conf"); |
$EXTRA_ARR = array(); |
foreach($ARR as $val) { |
$val=chop($val); |
if (preg_match('/^[[:space:]]*#/',$val) || preg_match('/^[[:space:]]*$/',$val)) |
continue; |
list($key,$v)=preg_split("/:[[:space:]]*/",$val,2); |
if (preg_match("/%\{(.+)\}/",$v,$matches)){ |
$val=$config[$matches[1]]; |
$v=preg_replace("/%\{$matches[1]\}/",$val,$v); |
} |
if (preg_match("/^nas(\d+)_(\w+)$/",$key,$matches)) |
$nas_list[$matches[1]][$matches[2]] = $v; |
if ($key == 'INCLUDE'){ |
if (is_readable($v)) |
array_push($EXTRA_ARR,file($v)); |
else |
echo "<b>Error: File '$v' does not exist or is not readable</b><br>\n"; |
} |
else |
$config["$key"]="$v"; |
} |
foreach($EXTRA_ARR as $val1) { |
foreach($val1 as $val){ |
$val=chop($val); |
if (preg_match('/^[[:space:]]*#/',$val) || preg_match('/^[[:space:]]*$/',$val)) |
continue; |
list($key,$v)=preg_split("/:[[:space:]]*/",$val,2); |
if (preg_match("/%\{(.+)\}/",$v,$matches)){ |
$val=$config[$matches[1]]; |
$v=preg_replace("/%\{$matches[1]\}/",$val,$v); |
} |
if (preg_match("/^nas(\d+)_(\w+)$/",$key,$matches)) |
$nas_list[$matches[1]][$matches[2]] = $v; |
$config["$key"]="$v"; |
} |
} |
if ($use_session){ |
session_register('config'); |
session_register('nas_list'); |
} |
} |
if ($use_session == 0 && $config['general_use_session'] == 'yes'){ |
// Start session |
@session_start(); |
if (isset($nas_list)) |
session_register('nas_list'); |
} |
//Make sure we are only passed allowed strings in username |
if (isset($login)){ |
if ($login != '') |
$login = preg_replace("/[^\w\.\/\@\:\-]/",'',$login); |
if ($login != '' && $config['general_strip_realms'] == 'yes'){ |
$realm_del = ($config['general_realm_delimiter'] != '') ? $config['general_realm_delimiter'] : '@'; |
$realm_for = ($config['general_realm_format'] != '') ? $config['general_realm_format'] : 'suffix'; |
$new = explode($realm_del,$login,2); |
if (count($new) == 2) |
$login = ($realm_for == 'suffix') ? $new[0] : $new[1]; |
} |
} |
unset($mappings); |
if (isset($_SESSION['mappings'])) |
$mappings = $_SESSION['mappings']; |
if (!isset($mappings) && $config['general_username_mappings_file'] != ''){ |
$ARR = file($config['general_username_mappings_file']); |
foreach($ARR as $val){ |
$val=chop($val); |
if (preg_match('/^[[:space:]]*#/',$val) || preg_match('/^[[:space:]]*$/',$val)) |
continue; |
list($key,$realm,$v)=preg_split("/:[[:space:]]*/",$val,3); |
if ($realm == 'accounting' || $realm == 'userdb' || $realm == 'nasdb' || $realm == 'nasadmin') |
$mappings["$key"][$realm] = $v; |
if ($realm == 'nasdb'){ |
$NAS_ARR = array(); |
$NAS_ARR = explode(',',$v); |
foreach ($nas_list as $key => $nas){ |
foreach ($NAS_ARR as $nas_check){ |
if ($nas_check == $nas['name']) |
unset($nas_list[$key]); |
} |
} |
} |
} |
if ($config['general_use_session'] == 'yes') |
session_register('mappings'); |
} |
//Include missing.php if needed |
if (!function_exists('array_change_key_case')) |
include_once('../lib/missing.php'); |
@header('Content-type: text/html; charset='.$config['general_charset'].';'); |
?> |
/conf/freeradius-web/config.php.default |
---|
0,0 → 1,117 |
<?php |
# |
# Things should work even if register_globals is set to off |
# |
$testVer=intval(str_replace(".", "",'4.1.0')); |
$curVer=intval(str_replace(".", "",phpversion())); |
if( $curVer >= $testVer ) |
import_request_variables('GPC'); |
# If using sessions set use_session to 1 to also cache the config file |
# |
$use_session = 0; |
unset($config); |
unset($nas_list); |
if ($use_session){ |
// Start session |
@session_start(); |
if (isset($_SESSION['config'])) |
$config = $_SESSION['config']; |
if (isset($_SESSION['nas_list'])) |
$nas_list = $_SESSION['nas_list']; |
} |
if (!isset($config)){ |
$ARR=file("/etc/freeradius-web/admin.conf"); |
$EXTRA_ARR = array(); |
foreach($ARR as $val) { |
$val=chop($val); |
if (preg_match('/^[[:space:]]*#/',$val) || preg_match('/^[[:space:]]*$/',$val)) |
continue; |
list($key,$v)=preg_split("/:[[:space:]]*/",$val,2); |
if (preg_match("/%\{(.+)\}/",$v,$matches)){ |
$val=$config[$matches[1]]; |
$v=preg_replace("/%\{$matches[1]\}/",$val,$v); |
} |
if (preg_match("/^nas(\d+)_(\w+)$/",$key,$matches)) |
$nas_list[$matches[1]][$matches[2]] = $v; |
if ($key == 'INCLUDE'){ |
if (is_readable($v)) |
array_push($EXTRA_ARR,file($v)); |
else |
echo "<b>Error: File '$v' does not exist or is not readable</b><br>\n"; |
} |
else |
$config["$key"]="$v"; |
} |
foreach($EXTRA_ARR as $val1) { |
foreach($val1 as $val){ |
$val=chop($val); |
if (preg_match('/^[[:space:]]*#/',$val) || preg_match('/^[[:space:]]*$/',$val)) |
continue; |
list($key,$v)=preg_split("/:[[:space:]]*/",$val,2); |
if (preg_match("/%\{(.+)\}/",$v,$matches)){ |
$val=$config[$matches[1]]; |
$v=preg_replace("/%\{$matches[1]\}/",$val,$v); |
} |
if (preg_match("/^nas(\d+)_(\w+)$/",$key,$matches)) |
$nas_list[$matches[1]][$matches[2]] = $v; |
$config["$key"]="$v"; |
} |
} |
if ($use_session){ |
session_register('config'); |
session_register('nas_list'); |
} |
} |
if ($use_session == 0 && $config[general_use_session] == 'yes'){ |
// Start session |
@session_start(); |
if (isset($nas_list)) |
session_register('nas_list'); |
} |
//Make sure we are only passed allowed strings in username |
if ($login != '') |
$login = preg_replace("/[^\w\.\/\@\:\-]/",'',$login); |
if ($login != '' && $config[general_strip_realms] == 'yes'){ |
$realm_del = ($config[general_realm_delimiter] != '') ? $config[general_realm_delimiter] : '@'; |
$realm_for = ($config[general_realm_format] != '') ? $config[general_realm_format] : 'suffix'; |
$new = explode($realm_del,$login,2); |
if (count($new) == 2) |
$login = ($realm_for == 'suffix') ? $new[0] : $new[1]; |
} |
unset($mappings); |
if (isset($_SESSION['mappings'])) |
$mappings = $_SESSION['mappings']; |
if (!isset($mappings) && $config[general_username_mappings_file] != ''){ |
$ARR = file($config[general_username_mappings_file]); |
foreach($ARR as $val){ |
$val=chop($val); |
if (preg_match('/^[[:space:]]*#/',$val) || preg_match('/^[[:space:]]*$/',$val)) |
continue; |
list($key,$realm,$v)=preg_split("/:[[:space:]]*/",$val,3); |
if ($realm == 'accounting' || $realm == 'userdb' || $realm == 'nasdb' || $realm == 'nasadmin') |
$mappings["$key"][$realm] = $v; |
if ($realm == 'nasdb'){ |
$NAS_ARR = array(); |
$NAS_ARR = preg_split('/,/',$v); |
foreach ($nas_list as $key => $nas){ |
foreach ($NAS_ARR as $nas_check){ |
if ($nas_check == $nas[name]) |
unset($nas_list[$key]); |
} |
} |
} |
} |
if ($config[general_use_session] == 'yes') |
session_register('mappings'); |
} |
date_default_timezone_set($config[timezone]); |
//Include missing.php if needed |
if (!function_exists('array_change_key_case')) |
include_once('../lib/missing.php'); |
@header('Content-type: text/html; charset='.$config[general_charset].';'); |
?> |
/conf/freeradius-web/default.vals |
---|
0,0 → 1,17 |
# |
# Uncomment and edit these lines if you add corresponding default |
# values in the users file |
# |
#Simultaneous-Use: 1 |
#Framed-IP-Address: 255.255.255.254 |
#Framed-IP-Netmask: 255.255.255.255 |
#Framed-MTU: 1500 |
#Framed-Protocol: PPP |
#Framed-Compression: Van-Jacobson-TCP-IP |
#Session-Timeout: 14400 |
#Idle-Timeout: 600 |
#Port-Limit: 1 |
#Max-Weekly-Session: 72000 |
#Max-Daily-Session: 14400 |
#Login-Time: |
#Auth-Type: LDAP |
/conf/freeradius-web/extra.ldap-attrmap |
---|
0,0 → 1,12 |
# |
# An extra file for radius -> ldap attribute mapping |
# |
checkItem Dialup-Lock-Msg radiuslockmsg |
checkItem User-Password userpassword |
checkItem Regular-Profile radiusProfileDn |
checkItem Check-Item radiusCheckItem generic |
checkItem Max-Daily-Session radiusMaxDailySession |
checkItem Max-Weekly-Session radiusMaxWeeklySession |
checkItem Max-Monthly-Session radiusMaxMonthlySession |
replyItem Reply-Item radiusReplyItem generic |
/conf/freeradius-web/naslist.conf |
---|
0,0 → 1,5 |
nas1_name: alcasar-esiea |
nas1_model: Portail captif |
nas1_ip: 192.168.182.1 |
nas1_port_num: 0 |
nas1_community: public |
/conf/freeradius-web/sql.attrmap |
---|
0,0 → 1,59 |
# |
# A mapping between the attributes used by dialup_admin and the attribute |
# names that will be stored in the SQL database |
# |
# Attributes that are not contained in this file are assumed to be reply |
# items and map to the same name as the one used by dialup_admin |
# |
# Format: |
# checkItem|replyItem Attribute-In-Dialup-Admin Attribute-In-SQL |
# |
# |
checkItem Auth-Type Auth-Type |
checkItem Simultaneous-Use Simultaneous-Use |
checkItem Called-Station-Id Called-Station-Id |
checkItem Calling-Station-Id Calling-Station-Id |
checkItem Dialup-Access none |
checkItem Max-All-Session Max-All-Session |
checkItem Max-Daily-Session Max-Daily-Session |
checkItem Max-Weekly-Session Max-Weekly-Session |
checkItem Max-Monthly-Session Max-Monthly-Session |
checkItem Login-Time Login-Time |
checkItem Expiration Expiration |
replyItem Service-Type Service-Type |
replyItem Framed-Protocol Framed-Protocol |
replyItem Framed-IP-Address Framed-IP-Address |
replyItem Framed-IP-Netmask Framed-IP-Netmask |
replyItem Framed-Route Framed-Route |
replyItem Framed-Routing Framed-Routing |
replyItem Filter-Id Filter-Id |
replyItem Framed-MTU Framed-MTU |
replyItem Framed-Compression Framed-Compression |
replyItem Login-IP-Host Login-IP-Host |
replyItem Login-Service Login-Service |
replyItem Login-TCP-Port Login-TCP-Port |
replyItem Callback-Number Callback-Number |
replyItem Callback-Id Callback-Id |
replyItem Framed-IPX-Network Framed-IPX-Network |
replyItem Class Class |
replyItem Session-Timeout Session-Timeout |
replyItem Idle-Timeout Idle-Timeout |
replyItem Termination-Action Termination-Action |
replyItem Login-LAT-Service Login-LAT-Service |
replyItem Login-LAT-Node Login-LAT-Node |
replyItem Login-LAT-Group Login-LAT-Group |
replyItem Framed-AppleTalk-Link Framed-AppleTalk-Link |
replyItem Framed-AppleTalk-Network Framed-AppleTalk-Network |
replyItem Framed-AppleTalk-Zone Framed-AppleTalk-Zone |
replyItem Port-Limit Port-Limit |
replyItem Login-LAT-Port Login-LAT-Port |
replyitem Reply-Message Reply-Message |
replyItem Dialup-Lock-Msg Reply-Message |
replyItem User-Password User-Password |
replyItem ChilliSpot-Max-Input-Octets ChilliSpot-Max-Input-Octets |
replyItem ChilliSpot-max-Output-Octets ChilliSpot-Max-Output-Octets |
replyItem ChilliSpot-Max-Total-Octets ChilliSpot-Max-Total-Octets |
replyItem ChilliSpot-Bandwidth-Max-Up ChilliSpot-Bandwidth-Max-Up |
replyItem ChilliSpot-Bandwidth-Max-Down ChilliSpot-Bandwidth-Max-Down |
replyItem WISPr-Redirection-URL WISPr-Redirection-URL |
/conf/freeradius-web/sql.attrmap.default |
---|
0,0 → 1,52 |
# |
# A mapping between the attributes used by dialup_admin and the attribute |
# names that will be stored in the SQL database |
# |
# Attributes that are not contained in this file are assumed to be reply |
# items and map to the same name as the one used by dialup_admin |
# |
# Format: |
# checkItem|replyItem Attribute-In-Dialup-Admin Attribute-In-SQL |
# |
# |
checkItem Auth-Type Auth-Type |
checkItem Simultaneous-Use Simultaneous-Use |
checkItem Called-Station-Id Called-Station-Id |
checkItem Calling-Station-Id Calling-Station-Id |
checkItem Dialup-Access none |
checkItem Max-Daily-Session Max-Daily-Session |
checkItem Max-Weekly-Session Max-Weekly-Session |
checkItem Max-Monthly-Session Max-Monthly-Session |
checkItem Login-Time Login-Time |
checkItem Expiration Expiration |
replyItem Service-Type Service-Type |
replyItem Framed-Protocol Framed-Protocol |
replyItem Framed-IP-Address Framed-IP-Address |
replyItem Framed-IP-Netmask Framed-IP-Netmask |
replyItem Framed-Route Framed-Route |
replyItem Framed-Routing Framed-Routing |
replyItem Filter-Id Filter-Id |
replyItem Framed-MTU Framed-MTU |
replyItem Framed-Compression Framed-Compression |
replyItem Login-IP-Host Login-IP-Host |
replyItem Login-Service Login-Service |
replyItem Login-TCP-Port Login-TCP-Port |
replyItem Callback-Number Callback-Number |
replyItem Callback-Id Callback-Id |
replyItem Framed-IPX-Network Framed-IPX-Network |
replyItem Class Class |
replyItem Session-Timeout Session-Timeout |
replyItem Idle-Timeout Idle-Timeout |
replyItem Termination-Action Termination-Action |
replyItem Login-LAT-Service Login-LAT-Service |
replyItem Login-LAT-Node Login-LAT-Node |
replyItem Login-LAT-Group Login-LAT-Group |
replyItem Framed-AppleTalk-Link Framed-AppleTalk-Link |
replyItem Framed-AppleTalk-Network Framed-AppleTalk-Network |
replyItem Framed-AppleTalk-Zone Framed-AppleTalk-Zone |
replyItem Port-Limit Port-Limit |
replyItem Login-LAT-Port Login-LAT-Port |
replyitem Reply-Message Reply-Message |
replyItem Dialup-Lock-Msg Reply-Message |
replyItem User-Password User-Password |
/conf/freeradius-web/sql.attrs |
---|
0,0 → 1,28 |
# Used by the Accounting Report Generator page |
# |
# Mysql attributes Description Show Use function |
# |
RadAcctId Accounting Id no |
AcctSessionId Session Id no |
AcctUniqueId Unique Id no |
UserName User Name yes |
Realm Realm no |
NASIPAddress Nas IP Address no |
NASPortId Nas Port no |
NASPortType NAS Port Type no |
AcctStartTime Login Time yes |
AcctStopTime Logout Time yes |
AcctSessionTime Session Time yes time2str |
AcctAuthentic AcctAuthentic no |
ConnectInfo_start Start Connect Info no |
ConnectInfo_stop Stop Connect Info no |
AcctInputOctets Upload yes bytes2str |
AcctOutputOctets Download yes bytes2str |
CalledStationId CalledStationId no |
CallingStationId Caller Id no |
AcctTerminateCause Terminate Cause no |
ServiceType Service Type no |
FramedProtocol Protocol no |
FramedIPAddress Client IP Address yes |
AcctStartDelay Accounting Start Delay no time2str |
AcctStopDelay Accounting Stop Delay no time2str |
/conf/freeradius-web/sql.attrs.default |
---|
0,0 → 1,28 |
# Used by the Accounting Report Generator page |
# |
# Mysql attributes Description Show Use function |
# |
RadAcctId Accounting Id no |
AcctSessionId Session Id no |
AcctUniqueId Unique Id no |
UserName User Name yes |
Realm Realm no |
NASIPAddress NAS IP Address yes |
NASPortId NAS Port yes |
NASPortType NAS Port Type no |
AcctStartTime Login Time yes |
AcctStopTime Logout Time yes |
AcctSessionTime Session Time yes time2str |
AcctAuthentic AcctAuthentic no |
ConnectInfo_start Start Connect Info no |
ConnectInfo_stop Stop Connect Info no |
AcctInputOctets Upload yes bytes2str |
AcctOutputOctets Download yes bytes2str |
CalledStationId CalledStationId no |
CallingStationId Caller Id no |
AcctTerminateCause Terminate Cause no |
ServiceType Service Type no |
FramedProtocol Protocol no |
FramedIPAddress Client IP Address yes |
AcctStartDelay Accounting Start Delay no time2str |
AcctStopDelay Accounting Stop Delay no time2str |
/conf/freeradius-web/user_edit.attrs |
---|
0,0 → 1,59 |
# |
# Attributes which will be visible in the user/group edit pages |
# File from free-radiusweb project. |
# Addons for ALCASAR by Steweb and Rexy |
# |
# Format: Attribute Comment |
# |
Expiration <a href="help/expiration_help.html" target=lt_help onclick=window.open("help/expiration_help.html","lt_help","width=600,height=250,toolbar=no,scrollbars=no,resizable=yes") title="Expiration Help Page"><font color="blue">Date d'expiration</font></a> |
Max-All-Session <a href="help/max_all_session_help.html" target=st_help onclick=window.open("help/max_all_session_help.html","st_help","width=600,height=250,toolbar=no,scrollbars=no,resizable=yes") title="Max connection Time Help Page"><font color="blue">Durée totale de connexion autorisée</font></a><BR>(en secondes) |
Session-Timeout <a href="help/session_timeout_help.html" target=st_help onclick=window.open("help/session_timeout_help.html","st_help","width=600,height=250,toolbar=no,scrollbars=no,resizable=yes") title="Session Timeout Help Page"><font color="blue">Durée maximale d'une session</font></a><BR>(en secondes) |
Max-Daily-Session <a href="help/session_timeout_help.html" target=st_help onclick=window.open("help/session_timeout_help.html","st_help","width=600,height=250,toolbar=no,scrollbars=no,resizable=yes") title="Session Timeout Help Page"><font color="blue">Durée limite journalière</font></a><BR>(en secondes) |
#Max-Weekly-Session Weekly Limit (secs) |
Max-Monthly-Session <a href="help/session_timeout_help.html" target=st_help onclick=window.open("help/session_timeout_help.html","st_help","width=600,height=250,toolbar=no,scrollbars=no,resizable=yes") title="Session Timeout Help Page"><font color="blue">Durée limite mensuelle</font></a><BR>(en secondes) |
Simultaneous-Use <a href="help/simultaneous_use_help.html" target=su_help onclick=window.open("help/simultaneous_use_help.html","su_help","width=600,height=250,toolbar=no,scrollbars=no,resizable=yes") title="Simultaneous Use Help Page"><font color="blue">Nombre de sessions simultanées</font></a> |
Login-Time <a href="help/login_time_help.html" target=lt_help onclick=window.open("help/login_time_help.html","lt_help","width=600,height=370,toolbar=no,scrollbars=no,resizable=yes") title="Login-Time Help Page"><font color="blue">Période hebdomadaire</font></a> |
ChilliSpot-Max-Input-Octets <a href="help/chillispot_max_input_octets_help.html" target=st_help onclick=window.open("help/chillispot_max_input_octets_help.html","st_help","width=600,height=250,toolbar=no,scrollbars=no,resizable=yes") title="ChilliSpot Max Input Octets Help Page"><font color="blue">Nombre d'octets max. en émission</font></a><BR>(en octets) |
ChilliSpot-Max-Output-Octets <a href="help/chillispot_max_output_octets_help.html" target=st_help onclick=window.open("help/chillispot_max_output_octets_help.html","st_help","width=600,height=250,toolbar=no,scrollbars=no,resizable=yes") title="ChilliSpot Max Output Octets Help Page"><font color="blue">Nombre d'octets max. en réception</font></a><BR>(en octets) |
ChilliSpot-Max-Total-Octets <a href="help/chillispot_max_total_octets_help.html" target=st_help onclick=window.open("help/chillispot_max_total_octets_help.html","st_help","width=600,height=250,toolbar=no,scrollbars=no,resizable=yes") title="ChilliSpot Max Total Octets Help Page"><font color="blue">Nombre d'octets max. total transmit</font></a><BR>(en octets) |
ChilliSpot-Bandwidth-Max-Up <a href="help/chillispot_bandwidth_max_up_help.html" target=st_help onclick=window.open("help/chillispot_bandwidth_max_up_help.html","st_help","width=600,height=250,toolbar=no,scrollbars=no,resizable=yes") title="ChilliSpot Bandwidth Max Up Help Page"><font color="blue">Bande passante montante max.</font></a><BR>(en kbits/seconde) |
ChilliSpot-Bandwidth-Max-Down <a href="help/chillispot_bandwidth_max_down_help.html" target=st_help onclick=window.open("help/chillispot_bandwidth_max_down_help.html","st_help","width=600,height=250,toolbar=no,scrollbars=no,resizable=yes") title="ChilliSpot Bandwidth Max Down Help Page"><font color="blue">Bande passante descendante max.</font></a><BR>(en kbits/seconde) |
WISPr-Redirection-URL <a href="help/wispr_redirection_url_help.html" target=st_help onclick=window.open("help/wispr_redirection_url_help.html","st_help","width=600,height=250,toolbar=no,scrollbars=no,resizable=yes") title="ChilliSpot Bandwidth Max Down Help Page"><font color="blue">URL de redirection</font></a><BR> |
# |
##Auth-Type <a href="help/auth_type_help.html" target=su_help onclick=window.open("help/auth_type_help.html","su_help","width=560,height=230,toolbar=no,scrollbars=no,resizable=yes") title="Auth-Type Help Page"><font color="blue">Auth-Type</font></a> |
#Framed-Protocol <a href="help/framed_protocol_help.html" target=fpr_help onclick=window.open("help/framed_protocol_help.htlml","fpr_help","width=560,height=230,toolbar=no,scrollbars=no,resizable=yes") title="Framed-Protocol Help PPage"><font color="blue">Protocol</font></a> |
#Framed-IP-Address <a href="help/framed_ip_address_help.html" target=fia_help onclick=window.open("help/framed_ip_address_help.html","fia_help","width=560,height=230,toolbar=no,scrollbars=no,resizable=yes") title="Framed-IP-Address Help Page"><font color="blue">IP Address</font></a> |
#Framed-IP-Netmask IP Netmask |
#Framed-Route Route |
#Framed-Routing |
Filter-Id <a href="help/filtering_help.html" target=fid_help onclick=window.open("help/filtering_help.html","fid_help","width=560,height=250,toolbar=no,scrollbars=no,resizable=yes") title="Filtering Help Page"><font color="blue">Filtering</font></a> |
#Framed-MTU <a href="help/framed_mtu_help.html" target=fid_help onclick=window.open("help/framed_mtu_help.html","fid_help","width=560,height=230,toolbar=no,scrollbars=no,resizable=yes") title="Framed-MTU Help Page"><font color="blue">Framed-MTU</font></a> |
#Framed-Compression <a href="help/framed_compression_help.html" target=fc_help onclick=window.open("help/framed_compression_help.html","fc_help","width=600,height=210,toolbar=no,scrollbars=no,resizable=yes") title="Framed Compression Help Page"><font color="blue">Compression Used</font></a> |
#Service-Type <a href="help/service_type_help.html" target=st_help onclick=window.open("help/service_type_help.html","st_help","width=560,height=230,toolbar=no,scrollbars=no,resizable=yes") title="Service-Type Help Page"><font color="blue">Service Type</font></a> |
#Login-IP-Host |
#Login-Service |
#Login-TCP-Port |
#Callback-Number <a href="help/callback_number_help.html" target=fid_help onclick=window.open("help/callback_number_help.html","fid_help","width=560,height=230,toolbar=no,scrollbars=no,resizable=yes") title="Callback-Number Help Page"><font color="blue">Callback-Number</font></a> |
#Callback-Id <a href="help/callback_id_help.html" target=fid_help onclick=window.open("help/callback_id_help.html","fid_help","width=560,height=230,toolbar=no,scrollbars=no,resizable=yes") title="Callback-ID Help Page"><font color="blue">Callback-ID</font></a> |
#Framed-IPX-Network |
#Class <a href="help/class_help.html" target=fid_help onclick=window.open("help/class_help.html","fid_help","width=560,height=230,toolbar=no,scrollbars=no,resizable=yes") title="Class Help Page"><font color="blue">Class</font></a> |
#Idle-Timeout <a href="help/idle_timeout_help.html" target=it_help onclick=window.open("help/idle_timeout_help.html","it_help","width=600,height=170,toolbar=no,scrollbars=no,resizable=yes") title="Idle Timeout Help Page"><font color="blue">Idle Timeout</font></a> |
#Termination-Action |
#Login-LAT-Service |
#Login-LAT-Node |
#Login-LAT-Group |
#Framed-AppleTalk-Link |
#Framed-AppleTalk-Network |
#Framed-AppleTalk-Zone |
#Port-Limit <a href="help/port_limit_help.html" target=pl_help onclick=window.open("help/port_limit_help.html","pl_help","width=600,height=170,toolbar=no,scrollbars=no,resizable=yes") title="Port Limit Help Page"><font color="blue">Port Limit</font></a> |
#Login-LAT-Port |
#Dialup-Access <a href="help/dialup_access_help.html" target=da_help onclick=window.open("help/dialup_access_help.html","da_help","width=560,height=200,toolbar=no,scrollbars=no,resizable=yes") title="Dialup Access Help Page"><font color="blue">Dialup Access (use FALSE to lock)</font></a> |
#Dialup-Lock-Msg <a href="help/lock_message_help.html" target=lm_help onclick=window.open("help/lock_message_help.html","lm_help","width=600,height=210,toolbar=no,scrollbars=no,resizable=yes") title="Lock Message Help Page"><font color="blue">Lock Message</font></a> |
#Reply-Message <a href="help/reply_message_help.html" target=lm_help onclick=window.open("help/reply_message_help.html","lm_help","width=600,height=210,toolbar=no,scrollbars=no,resizable=yes") title="Reply-Message Help Page"><font color="blue">Reply-Message</font></a> |
#Login-Time <a href="login_time_create.php?val=$name1&first=yes" target=lt_create onclick=window.open("login_time_create.php?val=$name1&first=yes","lt_create","width=600,height=490,toolbar=no,scrollbars=yes,resizable=yes") title="Login-Time Creation Page"><font color="blue">Période hebdomadaire</font></a><a href="help/login_time_help.html" target=lt_help onclick=window.open("help/login_time_help.html","lt_help","width=600,height=370,toolbar=no,scrollbars=no,resizable=yes") title="Login-Time Help Page"><font color="blue"><BR>(Format UUCP)</font></a> |
# |
# Uncomment this if you are using ldap and you are using user regular profiles. |
# Also make sure that Regular-Profile maps to the correct ldap attribute in |
# extra.ldap-attrmap |
# |
#Regular-Profile User Regular Profile DN |
/conf/freeradius-web/user_edit.attrs.default |
---|
0,0 → 1,49 |
# |
# Attributes which will be visible in the user/group edit pages |
# |
# Format: Attribute Comment |
# |
# |
#Auth-Type <a href="help/auth_type_help.html" target=su_help onclick=window.open("help/auth_type_help.html","su_help","width=560,height=230,toolbar=no,scrollbars=no,resizable=yes") title="Auth-Type Help Page"><font color="blue">Auth-Type</font></a> |
#Simultaneous-Use <a href="help/simultaneous_use_help.html" target=su_help onclick=window.open("help/simultaneous_use_help.html","su_help","width=560,height=170,toolbar=no,scrollbars=no,resizable=yes") title="Simultaneous Use Help Page"><font color="blue">Simultaneous Use</font></a> |
Framed-Protocol <a href="help/framed_protocol_help.html" target=fpr_help onclick=window.open("help/framed_protocol_help.htlml","fpr_help","width=560,height=230,toolbar=no,scrollbars=no,resizable=yes") title="Framed-Protocol Help PPage"><font color="blue">Protocol</font></a> |
Framed-IP-Address <a href="help/framed_ip_address_help.html" target=fia_help onclick=window.open("help/framed_ip_address_help.html","fia_help","width=560,height=230,toolbar=no,scrollbars=no,resizable=yes") title="Framed-IP-Address Help Page"><font color="blue">IP Address</font></a> |
Framed-IP-Netmask IP Netmask |
#Framed-Route Route |
#Framed-Routing |
#Filter-Id <a href="help/filter_id_help.html" target=fid_help onclick=window.open("help/filter_id_help.html","fid_help","width=560,height=230,toolbar=no,scrollbars=no,resizable=yes") title="Filter-ID Help Page"><font color="blue">Filter ID</font></a> |
Framed-MTU <a href="help/framed_mtu_help.html" target=fid_help onclick=window.open("help/framed_mtu_help.html","fid_help","width=560,height=230,toolbar=no,scrollbars=no,resizable=yes") title="Framed-MTU Help Page"><font color="blue">Framed-MTU</font></a> |
Framed-Compression <a href="help/framed_compression_help.html" target=fc_help onclick=window.open("help/framed_compression_help.html","fc_help","width=600,height=210,toolbar=no,scrollbars=no,resizable=yes") title="Framed Compression Help Page"><font color="blue">Compression Used</font></a> |
Service-Type <a href="help/service_type_help.html" target=st_help onclick=window.open("help/service_type_help.html","st_help","width=560,height=230,toolbar=no,scrollbars=no,resizable=yes") title="Service-Type Help Page"><font color="blue">Service Type</font></a> |
#Login-IP-Host |
#Login-Service |
#Login-TCP-Port |
#Callback-Number <a href="help/callback_number_help.html" target=fid_help onclick=window.open("help/callback_number_help.html","fid_help","width=560,height=230,toolbar=no,scrollbars=no,resizable=yes") title="Callback-Number Help Page"><font color="blue">Callback-Number</font></a> |
#Callback-Id <a href="help/callback_id_help.html" target=fid_help onclick=window.open("help/callback_id_help.html","fid_help","width=560,height=230,toolbar=no,scrollbars=no,resizable=yes") title="Callback-ID Help Page"><font color="blue">Callback-ID</font></a> |
#Framed-IPX-Network |
#Class <a href="help/class_help.html" target=fid_help onclick=window.open("help/class_help.html","fid_help","width=560,height=230,toolbar=no,scrollbars=no,resizable=yes") title="Class Help Page"><font color="blue">Class</font></a> |
Session-Timeout <a href="help/session_timeout_help.html" target=st_help onclick=window.open("help/session_timeout_help.html","st_help","width=600,height=170,toolbar=no,scrollbars=no,resizable=yes") title="Session Timeout Help Page"><font color="blue">Session Timeout</font></a> |
Idle-Timeout <a href="help/idle_timeout_help.html" target=it_help onclick=window.open("help/idle_timeout_help.html","it_help","width=600,height=170,toolbar=no,scrollbars=no,resizable=yes") title="Idle Timeout Help Page"><font color="blue">Idle Timeout</font></a> |
#Termination-Action |
#Login-LAT-Service |
#Login-LAT-Node |
#Login-LAT-Group |
#Framed-AppleTalk-Link |
#Framed-AppleTalk-Network |
#Framed-AppleTalk-Zone |
Port-Limit <a href="help/port_limit_help.html" target=pl_help onclick=window.open("help/port_limit_help.html","pl_help","width=600,height=170,toolbar=no,scrollbars=no,resizable=yes") title="Port Limit Help Page"><font color="blue">Port Limit</font></a> |
#Login-LAT-Port |
#Dialup-Access <a href="help/dialup_access_help.html" target=da_help onclick=window.open("help/dialup_access_help.html","da_help","width=560,height=200,toolbar=no,scrollbars=no,resizable=yes") title="Dialup Access Help Page"><font color="blue">Dialup Access (use FALSE to lock)</font></a> |
Dialup-Lock-Msg <a href="help/lock_message_help.html" target=lm_help onclick=window.open("help/lock_message_help.html","lm_help","width=600,height=210,toolbar=no,scrollbars=no,resizable=yes") title="Lock Message Help Page"><font color="blue">Lock Message</font></a> |
#Reply-Message <a href="help/reply_message_help.html" target=lm_help onclick=window.open("help/reply_message_help.html","lm_help","width=600,height=210,toolbar=no,scrollbars=no,resizable=yes") title="Reply-Message Help Page"><font color="blue">Reply-Message</font></a> |
#Max-Daily-Session Daily Limit (secs) |
#Max-Weekly-Session Weekly Limit (secs) |
#Max-Monthly-Session Monthly Limit (secs) |
#Login-Time <a href="login_time_create.php?val=$name1&first=yes" target=lt_create onclick=window.open("login_time_create.php?val=$name1&first=yes","lt_create","width=600,height=490,toolbar=no,scrollbars=yes,resizable=yes") title="Login-Time Creation Page"><font color="blue">User Login Period </font></a>(<a href="help/login_time_help.html" target=lt_help onclick=window.open("help/login_time_help.html","lt_help","width=600,height=370,toolbar=no,scrollbars=no,resizable=yes") title="Login-Time Help Page"><font color="blue">UUCP </font></a>Format) |
#Expiration <a href="help/expiration_help.html" target=lt_help onclick=window.open("help/expiration_help.html","lt_help","width=600,height=180,toolbar=no,scrollbars=no,resizable=yes") title="Expiration Help Page"><font color="blue">User Expiration Date</font></a> |
# |
# Uncomment this if you are using ldap and you are using user regular profiles. |
# Also make sure that Regular-Profile maps to the correct ldap attribute in |
# extra.ldap-attrmap |
# |
#Regular-Profile User Regular Profile DN |
/conf/freeradius-web/username.mappings |
---|
0,0 → 1,21 |
# Username mappings |
# Format: |
# Username:realm:query |
# |
# where realm is: |
# accounting: for the map to be used when querying the accounting db |
# userdb: for the map to be used when querying the user db |
# nasdb: To only map specific NASes to the username (separated by ,) |
# nasadmin: To allow the user to use the nas_admin page (yes or no) |
# |
library-admin:accounting:AND nasipaddress = '123.123.123.123' |
library-admin:userdb:AND Admin = 'library-admin' |
library-admin:nasdb:nas.lib.company.com |
library-admin:nasadmin:no |
# |
lab-admin:accounting:AND nasipaddress = '123.123.124.123' |
lab-admin:userdb:AND Admin = 'lab-admin' |
lab-admin:nasdb:nas.lab.company.com |
lab-admin:nasadmin:no |
# |
admin:nasadmin:yes |
/scripts/alcasar-urpmi.sh |
---|
15,7 → 15,7 |
KERNEL="kernel-server-4.1.15-2.mga5-1-1.mga5" |
ModuleTree="kernel-server-4.1.15-2.mga5" |
# ****** Alcasar needed RPMS - paquetages nécessaires au fonctionnement d'Alcasar ****** |
PACKAGES="vim-enhanced freeradius freeradius-mysql freeradius-ldap freeradius-web apache apache-mod_ssl apache-mod_php dansguardian postfix mariadb ntp bind-utils openssh-server php-xml php-ldap php-mysql php-mysqli php-mbstring php-sockets php-cli php-curl php-pdo_sqlite php-json rng-utils rsync clamav perl-rrdtool perl-MailTools perl-Socket6 fail2ban gnupg ulogd pm-fallback-policy ipset cronie-anacron gammu usbutils locales-en usb_modeswitch tinyproxy vnstat php-gd sudo iftop" |
PACKAGES="vim-enhanced freeradius freeradius-mysql freeradius-ldap apache apache-mod_ssl apache-mod_php dansguardian postfix mariadb ntp bind-utils openssh-server php-xml php-ldap php-mysql php-mysqli php-mbstring php-sockets php-cli php-curl php-pdo_sqlite php-json rng-utils rsync clamav perl-rrdtool perl-MailTools perl-Socket6 fail2ban gnupg ulogd pm-fallback-policy ipset cronie-anacron gammu usbutils locales-en usb_modeswitch tinyproxy vnstat php-gd sudo iftop" |
rpm_repository_sync () |
{ |
/web/acc/manager/htdocs/accounting.php |
---|
25,22 → 25,22 |
} |
$operators=array( '=','<', '>', '<=', '>=', 'regexp', 'like' ); |
if ($config[sql_type] == 'pg'){ |
if ($config['sql_type'] == 'pg'){ |
$operators=array( '=','<', '>', '<=', '>=', '~', 'like', '~*', '~~*', '<<=' ); |
} |
$link = @da_sql_pconnect ($config) or die('cannot connect to sql databse'); |
$fields = @da_sql_list_fields($config[sql_accounting_table],$link,$config); |
$no_fields = @da_sql_num_fields($fields,$config); |
$link = da_sql_pconnect ($config) or die('cannot connect to sql databse'); |
$fields = da_sql_list_fields($config[sql_accounting_table],$link,$config); |
$no_fields = da_sql_num_fields($fields,$config); |
unset($items); |
for($i=0;$i<$no_fields;$i++){ |
$key = strtolower(@da_sql_field_name($fields,$i,$config)); |
$val = $sql_attrs[$key][desc]; |
$key = strtolower(da_sql_field_name($fields,$i,$config)); |
$val = $sql_attrs[$key]['desc']; |
if ($val == '') |
continue; |
$show = $sql_attrs[$key][show]; |
$show = $sql_attrs[$key]['show']; |
$selected[$key] = ($show == 'yes') ? 'selected' : ''; |
$items[$key] = "$val"; |
} |
263,9 → 263,9 |
} |
echo "</tr>\n"; |
$search = @da_sql_query($link,$config,$query); |
$search = da_sql_query($link,$config,$query); |
if ($search){ |
while( $row = @da_sql_fetch_array($search,$config) ){ |
while( $row = da_sql_fetch_array($search,$config) ){ |
$num++; |
echo "<tr align=center>\n"; |
foreach($accounting_show_attrs as $val){ |
/web/acc/manager/htdocs/badusers.php |
---|
0,0 → 1,231 |
<?php |
require('/etc/freeradius-web/config.php'); |
require('../lib/functions.php'); |
?> |
<html> |
<?php |
if (is_file("../lib/sql/drivers/$config[sql_type]/functions.php")) |
include_once("../lib/sql/drivers/$config[sql_type]/functions.php"); |
else{ |
echo <<<EOM |
<title>Unauthorized Service Usage History for $login</title> |
<meta http-equiv="Content-Type" content="text/html; charset=$config[general_charset]"> |
<link rel="stylesheet" href="style.css"> |
</head> |
<body> |
<center> |
<b>Could not include SQL library functions. Aborting</b> |
</body> |
</html> |
EOM; |
exit(); |
} |
$now = time(); |
$now_str = ($now_str != '') ? "$now_str" : date($config[sql_date_format],$now + 86400); |
$prev_str = ($prev_str != '') ? "$prev_str" : "0001-01-01 00:00:00"; |
$now_str = da_sql_escape_string($now_str); |
$prev_str = da_sql_escape_string($prev_str); |
$num = 0; |
$pagesize = ($pagesize) ? $pagesize : 10; |
if (!is_numeric($pagesize) && $pagesize != 'all') |
$pagesize = 10; |
$limit = ($pagesize == 'all') ? '' : "$pagesize"; |
$selected[$pagesize] = 'selected'; |
$login = ($login != '') ? $login : 'anyone'; |
$usercheck = ($login == 'anyone') ? "LIKE '%'" : "= '$login'"; |
$order = ($order != '') ? $order : $config[general_accounting_info_order]; |
if ($order != 'desc' && $order != 'asc') |
$order = 'desc'; |
$selected[$order] = 'selected'; |
echo <<<EOM |
<head> |
<title>Unauthorized Service Usage History for $login</title> |
<meta http-equiv="Content-Type" content="text/html; charset=$config[general_charset]"> |
<link rel="stylesheet" href="style.css"> |
</head> |
<body> |
<center> |
<table border=0 width=550 cellpadding=0 cellspacing=0> |
<tr valign=top> |
<td align=center><img src="images/title2.gif"></td> |
</tr> |
</table> |
EOM; |
if ($login != 'anyone'){ |
echo <<<EOM |
<table border=0 width=400 cellpadding=0 cellspacing=2> |
EOM; |
include("../html/user_toolbar.html.php"); |
print <<<EOM |
</table> |
EOM; |
} |
if ($do_delete == 1 && ($row_id != 0 && is_numeric($row_id))){ |
$link = da_sql_connect($config); |
if ($link){ |
$search = da_sql_query($link,$config, |
"SELECT id,admin FROM $config[sql_badusers_table] |
WHERE id = '$row_id';"); |
if ($search){ |
$row = da_sql_fetch_array($search,$config); |
if ($row[id] == $row_id){ |
$admin = "$row[admin]"; |
if (($admin != '-' && $_SERVER["PHP_AUTH_USER"] == $admin) || $admin == '-'){ |
$sql_servers = array(); |
if ($config[sql_extra_servers] != '') |
$sql_servers = explode(' ',$config[sql_extra_servers]); |
$sql_servers[] = $config[sql_server]; |
foreach ($sql_servers as $server){ |
$link2 = da_sql_host_connect($server,$config); |
if ($link2){ |
$r = da_sql_query($link2,$config, |
"DELETE FROM $config[sql_badusers_table] |
WHERE id = '$row_id';"); |
if (!$r) |
echo "<b>SQL Error:" . da_sql_error($link2,$config) . "</b><br>\n"; |
da_sql_close($link2,$config); |
} |
else |
echo "<b>SQL Error: Could not connect to SQL database: $server</b><br>\n"; |
} |
} |
} |
} |
else |
echo "<b>Database query failed: " . da_sql_error($link,$config) . "</b><br>\n"; |
da_sql_close($link,$config); |
} |
else |
echo "<b>Could not connect to SQL database</b><br>\n"; |
} |
echo <<<EOM |
<br><br> |
<table border=0 width=740 cellpadding=1 cellspacing=1> |
<tr valign=top> |
<td width=55%></td> |
<td bgcolor="black" width=45%> |
<table border=0 width=100% cellpadding=2 cellspacing=0> |
<tr bgcolor="#907030" align=right valign=top><th> |
<font color="white">Unauthorized Service Usage History for $login</font> |
</th></tr> |
</table> |
</td></tr> |
<tr bgcolor="black" valign=top><td colspan=2> |
<table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top> |
<tr><td> |
<b>$prev_str</b> up to <b>$now_str</b> |
<form action="badusers.php" method="get" name="master"> |
<input type=hidden name=do_delete value=0> |
<input type=hidden name=row_id value=0> |
EOM; |
?> |
<p> |
<table border=1 bordercolordark=#ffffe0 bordercolorlight=#000000 width=100% cellpadding=2 cellspacing=0 bgcolor="#ffffe0" valign=top> |
<tr bgcolor="#d0ddb0"> |
<th>#</th><th>user</th><th>date</th><th>admin</th><th>reason</th><th>administrator action</th> |
</tr> |
<?php |
$auth_user = $_SERVER["PHP_AUTH_USER"]; |
if ($config[general_restrict_badusers_access] == 'yes'){ |
$auth_user = da_sql_escape_string($auth_user); |
$extra_query = "AND admin == '$auth_user'"; |
} |
$link = da_sql_pconnect($config); |
if ($link){ |
$search = da_sql_query($link,$config, |
"SELECT " . da_sql_limit($limit,0,$config) . " * FROM $config[sql_badusers_table] |
WHERE username $usercheck $extra_query AND incidentdate <= '$now_str' |
AND incidentdate >= '$prev_str' " . da_sql_limit($limit,1,$config) . |
" ORDER BY incidentdate $order " . da_sql_limit($limit,2,$config) . " ;"); |
if ($search){ |
while( $row = da_sql_fetch_array($search,$config) ){ |
$num++; |
$id = $row[id]; |
$user = "$row[username]"; |
$User = urlencode($user); |
$date = "$row[incidentdate]"; |
$reason = "$row[reason]"; |
$admin = "$row[admin]"; |
if ($admin == $auth_user || $admin == '-') |
$action = "<td><input type=submit class=button value=\"Delete\" OnClick=\"this.form.do_delete.value=1;this.form.row_id.value=$id\"></td>"; |
else |
$action = "<td>-</td>"; |
if ($admin == '') |
$admin = '-'; |
if ($reason == '') |
$reason = '-'; |
echo <<<EOM |
<tr align=center> |
<td>$num</td> |
<td><a href="user_admin.php?login=$User" title="Edit user $user">$user</a></td> |
<td>$date</td> |
<td>$admin</td> |
<td>$reason</td> |
$action |
</tr> |
EOM; |
} |
} |
else |
echo "<b>Database query failed: " . da_sql_error($link,$config) . "</b><br>\n"; |
} |
else |
echo "<b>Could not connect to SQL database</b><br>\n"; |
echo <<<EOM |
</table> |
<tr><td> |
<hr> |
<tr><td align="center"> |
<table border=0> |
<tr><td colspan=6></td> |
<td rowspan=3 valign="bottom"> |
<small> |
the <b>from</b> date matches any login after the 00:00 that day, |
and the <b>to</b> date any login before the 23:59 that day. |
the default values shown are the <b>current week</b>. |
</td> |
</tr> |
<tr valign="bottom"> |
<td><small><b>user</td><td><small><b>from date</td><td><small><b>to date</td><td><small><b>pagesize</td><td><b>order</td> |
</td> |
<tr valign="middle"><td> |
<input type="text" name="login" size="11" value="$login"></td> |
<td><input type="text" name="prev_str" size="11" value="$prev_str"></td> |
<td><input type="text" name="now_str" size="11" value="$now_str"></td> |
<td><select name="pagesize"> |
<option $selected[5] value="5" >05 |
<option $selected[10] value="10">10 |
<option $selected[15] value="15">15 |
<option $selected[20] value="20">20 |
<option $selected[40] value="40">40 |
<option $selected[80] value="80">80 |
<option $selected[all] value="all">all |
</select> |
</td> |
<td><select name="order"> |
<option $selected[asc] value="asc">older first |
<option $selected[desc] value="desc">recent first |
</select> |
</td> |
EOM; |
?> |
<td><input type="submit" class=button value="show"></td></tr> |
</table></td></tr></form> |
</table> |
</tr> |
</table> |
</body> |
</html> |
/web/acc/manager/htdocs/clear_opensessions.php |
---|
3,6 → 3,7 |
if (is_file("../lib/langues.php")) |
include("../lib/langues.php"); |
require('/etc/freeradius-web/config.php'); |
if(!isset($clear_sessions)) $clear_sessions = 0; |
if (is_file("../lib/$config[general_lib_type]/user_info.php")) |
include("../lib/$config[general_lib_type]/user_info.php"); |
if (is_file("../lib/sql/drivers/$config[sql_type]/functions.php")) |
32,7 → 33,7 |
<body> |
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0"> |
<tr><th>$l_users_managment</th></tr> |
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" |
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" |
height="2"></td></tr> |
</TABLE> |
<TABLE width="100%" border=0 cellspacing=0 cellpadding=1> |
63,7 → 64,7 |
<table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top> |
<tr><td> |
EOM; |
if ($clear_sessions == 1) |
{ |
# close active sessions |
71,10 → 72,10 |
# delete open accounting sessions |
$now = time(); |
$today_now = date("Y-m-d H:i:s",$now); |
$link = @da_sql_pconnect($config); |
$link = da_sql_pconnect($config); |
if ($link) |
{ |
$res = @da_sql_query($link,$config, |
$res = da_sql_query($link,$config, |
"UPDATE $config[sql_accounting_table] SET acctstoptime = '$today_now', acctterminatecause='Admin-Reset' |
WHERE username='$login' AND acctstoptime IS NULL;"); |
if (! $res) |
85,13 → 86,13 |
} |
# Count of accounting open sessions (in database) |
$open_accnt_sessions = 0; |
$link = @da_sql_pconnect($config); |
$link = da_sql_pconnect($config); |
if ($link){ |
$search = @da_sql_query($link,$config, |
$search = da_sql_query($link,$config, |
"SELECT COUNT(*) AS counter FROM $config[sql_accounting_table] |
WHERE username = '$login' AND acctstoptime IS NULL;"); |
if ($search){ |
if ($row = @da_sql_fetch_array($search,$config)) |
if ($row = da_sql_fetch_array($search,$config)) |
$open_accnt_sessions = $row['counter']; |
} |
else |
/web/acc/manager/htdocs/find.php |
---|
3,6 → 3,26 |
if (is_file("../lib/langues.php")) |
include("../lib/langues.php"); |
require('/etc/freeradius-web/config.php'); |
if(!isset($selected)) |
{ |
$selected['username'] = ''; |
$selected['name'] = ''; |
$selected['department'] = ''; |
$selected['radius'] = ''; |
$selected['Expiration'] = ''; |
$selected['Max-All-Session'] = ''; |
$selected['Session-Timeout'] = ''; |
$selected['Max-Daily-Session'] = ''; |
$selected['Max-Monthly-Session'] = ''; |
$selected['Simultaneous-Use'] = ''; |
$selected['Login-Time'] = ''; |
$selected['ChilliSpot-Max-Input-Octets'] = ''; |
$selected['ChilliSpot-Max-Total-Octets'] = ''; |
$selected['ChilliSpot-Bandwidth-Max-Up'] = ''; |
$selected['ChilliSpot-Bandwidth-Max-Down'] = ''; |
$selected['ChilliSpot-Max-Output-Octets'] = ''; |
$selected['WISPr-Redirection-URL'] = ''; |
} |
if (isset($search_IN)) $selected[$search_IN] = 'selected'; |
if (isset ($radius_attr)) $selected[$radius_attr] = 'selected'; |
if (isset ($max_results)){ $max = ($max_results) ? $max_results : 40;} |
16,7 → 36,7 |
<body> |
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0"> |
<tr><th><?php echo "$l_users_managment";?></th></tr> |
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" |
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" |
height="2"></td></tr> |
</TABLE> |
<TABLE width="100%" border=0 cellspacing=0 cellpadding=1> |
46,6 → 66,7 |
include("../lib/$config[general_lib_type]/find.php"); |
if (isset($found_users)){ |
$num = 0; |
$msg =''; |
$msg .= <<<EOM |
<table border=1 bordercolordark=#ffffe0 bordercolorlight=#000000 width=100% cellpadding=2 cellspacing=0 bgcolor="#ffffe0" valign=top> |
75,7 → 96,7 |
<a href="user_delete.php?login=$User" title="$l_remove"><img src=/images/state_error.gif></a></td><td> |
EOM; |
if (isset($member_groups)) foreach ($member_groups as $group) { $msg .= "$group";} |
else $msg .= " "; |
else $msg .= " "; |
$msg .= "</td>"; |
} |
$msg .= "</tr></table>\n"; |
121,57 → 142,57 |
foreach($show_attrs as $key => $desc) |
switch ($key) |
{ |
case 'Simultaneous-Use' : |
case 'Simultaneous-Use' : |
$desc=$l_simultaneous_use; |
echo "<option $selected[$key] value=\"$key\">$desc\n"; |
echo "<option $selected[$key] value=\"$key\">$desc\n"; |
break; |
case 'Max-All-Session' : |
$desc=$l_max_all_session; |
echo "<option $selected[$key] value=\"$key\">$desc\n"; |
echo "<option $selected[$key] value=\"$key\">$desc\n"; |
break; |
case 'Session-Timeout' : |
case 'Session-Timeout' : |
$desc=$l_session_timeout; |
echo "<option $selected[$key] value=\"$key\">$desc\n"; |
echo "<option $selected[$key] value=\"$key\">$desc\n"; |
break; |
case 'Max-Daily-Session' : |
$desc=$l_daily_timeout; |
echo "<option $selected[$key] value=\"$key\">$desc\n"; |
echo "<option $selected[$key] value=\"$key\">$desc\n"; |
break; |
case 'Max-Monthly-Session' : |
$desc=$l_monthly_timeout; |
echo "<option $selected[$key] value=\"$key\">$desc\n"; |
echo "<option $selected[$key] value=\"$key\">$desc\n"; |
break; |
case 'Login-Time' : |
case 'Login-Time' : |
$desc=$l_login_time; |
echo "<option $selected[$key] value=\"$key\">$desc\n"; |
echo "<option $selected[$key] value=\"$key\">$desc\n"; |
break; |
case 'Expiration' : |
$desc=$l_expiration; |
echo "<option $selected[$key] value=\"$key\">$desc\n"; |
echo "<option $selected[$key] value=\"$key\">$desc\n"; |
break; |
case 'ChilliSpot-Max-Input-Octets' : |
$desc=$l_max_input_octets; |
echo "<option $selected[$key] value=\"$key\">$desc\n"; |
echo "<option $selected[$key] value=\"$key\">$desc\n"; |
break; |
case 'ChilliSpot-Max-Output-Octets' : |
$desc=$l_max_output_octets; |
echo "<option $selected[$key] value=\"$key\">$desc\n"; |
echo "<option $selected[$key] value=\"$key\">$desc\n"; |
break; |
case 'ChilliSpot-Max-Total-Octets' : |
$desc=$l_max_total_octets; |
echo "<option $selected[$key] value=\"$key\">$desc\n"; |
echo "<option $selected[$key] value=\"$key\">$desc\n"; |
break; |
case 'ChilliSpot-Bandwidth-Max-Up' : |
$desc=$l_max_bandwidth_up; |
echo "<option $selected[$key] value=\"$key\">$desc\n"; |
echo "<option $selected[$key] value=\"$key\">$desc\n"; |
break; |
case 'ChilliSpot-Bandwidth-Max-Down' : |
$desc=$l_max_bandwidth_down; |
echo "<option $selected[$key] value=\"$key\">$desc\n"; |
echo "<option $selected[$key] value=\"$key\">$desc\n"; |
break; |
case 'WISPr-Redirection-URL' : |
$desc=$l_wispr_redirection; |
echo "<option $selected[$key] value=\"$key\">$desc\n"; |
echo "<option $selected[$key] value=\"$key\">$desc\n"; |
break; |
} |
echo <<<EOM |
197,7 → 218,7 |
<td> |
<input type=text name="max_results" value="<?php echo $max ?>" size=25> |
</td> |
</tr> --> |
</tr> --> |
</table> |
<br> |
<input type=submit class=button value="<?php echo"$l_search";?>" OnClick="this.form.find_user.value=1"> |
/web/acc/manager/htdocs/group_admin.php |
---|
3,11 → 3,11 |
if (is_file("../lib/langues.php")) |
include("../lib/langues.php"); |
require('/etc/freeradius-web/config.php'); |
if ($show == 1 && isset($del_members)){ |
if (isset($show) && $show == 1 && isset($del_members)){ |
header("Location: user_admin.php?login=$del_members[0]"); |
exit; |
} |
if ($config[general_lib_type] != 'sql'){ |
if ($config['general_lib_type'] != 'sql'){ |
echo <<<EOM |
<title>Admin_groups</title> |
<meta http-equiv="Content-Type" content="text/html; charset=$config[general_charset]"> |
28,7 → 28,7 |
if ($group_exists == 'no'){ |
echo <<<EOM |
<title>Admin_groups</title> |
<meta http-equiv="Content-Type" content="text/html; charset=$config[general_charset]"> |
<meta http-equiv="Content-Type" content="text/html" charset="$config[general_charset]"> |
<link rel="stylesheet" href="style.css"> |
</head> |
<body> |
36,7 → 36,7 |
<form action="group_admin.php" method=get> |
<b>Le groupe </b> |
<input type="text" size=10 name="login" value="$login"> |
<b> n'existe pas</b><br> |
<b> n''existe pas</b><br> |
<input type=submit class=button value="Show Group"> |
</body> |
</html> |
49,13 → 49,13 |
<html> |
<head> |
<title>Admin_groups</title> |
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $config[general_charset]?>"> |
<meta http-equiv="Content-Type" content="text/html" charset="<?php echo $config['general_charset']?>"> |
<link rel="stylesheet" href="/css/style.css"> |
</head> |
<body> |
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0"> |
<tr><th><?php echo "$l_groups_managment"; ?></th></tr> |
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" |
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" |
height="2"></td></tr> |
</TABLE> |
<TABLE width="100%" border=0 cellspacing=0 cellpadding=1> |
84,7 → 84,7 |
<tr><td> |
<?php |
if ($do_changes == 1){ |
if (isset($do_changes) && $do_changes == 1){ |
if (is_file("../lib/$config[general_lib_type]/group_admin.php")) |
include("../lib/$config[general_lib_type]/group_admin.php"); |
if (is_file("../lib/$config[general_lib_type]/group_info.php")) |
91,7 → 91,7 |
include("../lib/$config[general_lib_type]/group_info.php"); |
} |
?> |
<form method=post> |
<input type=hidden name=login value=<?php echo $login ?>> |
<input type=hidden name=do_changes value=0> |
102,7 → 102,7 |
<?php echo "$l_group_members_to_remove";?> |
</td> |
<td> |
<select name=del_members[] multiple size=5> |
<select name=del_members[] multiple size=5> |
<?php |
foreach ($group_members as $member){ |
echo "<option value=\"$member\">$member\n"; |
/web/acc/manager/htdocs/group_new.php |
---|
1,11 → 1,36 |
<?php |
if (!isset ($create)) $create=0; |
if (!isset ($login)) $login=''; |
if (!isset ($selected)) $selected=array(); |
/*if(!isset($selected)) |
{ |
$selected['username'] = ''; |
$selected['name'] = ''; |
$selected['department'] = ''; |
$selected['radius'] = ''; |
$selected['Expiration'] = ''; |
$selected['Max-All-Session'] = ''; |
$selected['Session-Timeout'] = ''; |
$selected['Max-Daily-Session'] = ''; |
$selected['Max-Monthly-Session'] = ''; |
$selected['Simultaneous-Use'] = ''; |
$selected['Login-Time'] = ''; |
$selected['ChilliSpot-Max-Input-Octets'] = ''; |
$selected['ChilliSpot-Max-Total-Octets'] = ''; |
$selected['ChilliSpot-Bandwidth-Max-Up'] = ''; |
$selected['ChilliSpot-Bandwidth-Max-Down'] = ''; |
$selected['ChilliSpot-Max-Output-Octets'] = ''; |
$selected['WISPr-Redirection-URL'] = ''; |
}*/ |
//Gestion de la langue |
if (is_file("../lib/langues.php")) |
include("../lib/langues.php"); |
require('/etc/freeradius-web/config.php'); |
if ($config[general_lib_type] != 'sql'){ |
if ($config['general_lib_type'] != 'sql'){ |
echo <<<EOM |
<title>$l_title</title> |
<meta http-equiv="Content-Type" content="text/html; charset=$config[general_charset]"> |
24,9 → 49,11 |
require('../lib/defaults.php'); |
require("../lib/$config[general_lib_type]/group_info.php"); |
if ($config[general_lib_type] == 'sql' && $config[sql_use_operators] == 'true'){ |
if ($config['general_lib_type'] == 'sql' && $config['sql_use_operators'] == 'true'){ |
$colspan=2; |
$show_ops=1; |
include_once("../lib/operators.php"); |
if(!isset($selected[$op_eq])) $selected[$op_eq] = ''; |
}else{ |
$show_ops = 0; |
$colspan=1; |
41,7 → 68,7 |
<script type="text/javascript" src="/js/fonctions.js"></script> |
<script language="javascript" type="text/javascript"> |
/*Insertion du calendrier*/ |
var dp_cal; |
var dp_cal; |
window.onload = function () { |
dp_cal = new Epoch('epoch_popup','popup',document.getElementById('popup_container')); |
}; |
51,7 → 78,7 |
<body> |
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0"> |
<tr><th><? echo "$l_groups_managment"; ?></th></tr> |
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" |
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" |
height="2"></td></tr> |
</TABLE> |
<TABLE width="100%" border=0 cellspacing=0 cellpadding=1> |
72,7 → 99,7 |
<tr bgcolor="black" valign=top><td colspan=2> |
<table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top> |
<tr><td> |
<?php |
if (is_file("../lib/$config[general_lib_type]/group_info.php")) |
include("../lib/$config[general_lib_type]/group_info.php"); |
105,7 → 132,7 |
if (!isset($existing_groups)) |
echo "<b>$l_group_empty</b>\n"; |
else{ |
echo "<select name=\"existing_groups\">\n"; |
echo "<select name=\"existing_groups\">\n"; |
foreach ($existing_groups as $group => $count) |
echo "<option value=\"$group\">$group\n"; |
echo "</select>\n"; |
127,7 → 154,7 |
<textarea name=members cols="50" wrap="PHYSICAL" rows=5></textarea> |
</td> |
</tr> |
EOM; |
foreach($show_attrs as $key => $desc){ |
$name = $attrmap["$key"]; |
134,11 → 161,17 |
if ($name == 'none') |
continue; |
$oper_name = $name . '_op'; |
$val = ($item_vals["$key"][0] != "") ? $item_vals["$key"][0] : $default_vals["$key"][0]; |
if(isset($item_vals["$key"][0]) && $item_vals["$key"][0] != ''){ |
$val = $item_vals["$key"][0]; |
} else if(isset($default_vals["$key"][0])) { |
$val = $default_vals["$key"][0]; |
} else { |
$val = ''; |
} |
switch ($key) |
{ |
// $advanced = 1 : champs de saisie amélioré (calendrier, convertisseur, etc.) |
case 'Simultaneous-Use' : |
// $advanced = 1 : champs de saisie amélioré (calendrier, convertisseur, etc.) |
case 'Simultaneous-Use' : |
$advanced=1; |
$help_link="help/simultaneous_use_help.html"; |
$desc=$l_simultaneous_use; |
148,7 → 181,7 |
$help_link="help/max_all_session_help.html"; |
$desc=$l_max_all_session; |
break; |
case 'Session-Timeout' : |
case 'Session-Timeout' : |
$advanced=1; |
$help_link="help/session_timeout_help.html"; |
$desc=$l_session_timeout; |
163,7 → 196,7 |
$help_link="help/session_timeout_help.html"; |
$desc=$l_monthly_timeout; |
break; |
case 'Login-Time' : |
case 'Login-Time' : |
$advanced=1; |
$help_link="help/login_time_help.html"; |
$desc=$l_login_time; |
228,12 → 261,12 |
</td> |
EOM; |
switch ($key){ |
case 'Simultaneous-Use' : |
case 'Simultaneous-Use' : |
case 'Max-All-Session' : |
case 'Max-Daily-Session' : |
case 'Max-Weekly-Session' : |
case 'Max-Monthly-Session' : |
case 'Login-Time' : |
case 'Login-Time' : |
case 'Expiration' : |
echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:="; |
break; |
272,9 → 305,9 |
break; |
} |
} |
/* |
Ajout du choix d'unité (pour les durées limites de session, journée et de mois) |
/* |
Ajout du choix d'unité (pour les durées limites de session, journée et de mois) |
et d'un calendrier pour la date d'expiration |
Sauf dans le cas de la visualisation |
*/ |
282,9 → 315,9 |
if ($create==0 ){ |
switch ($name){ |
/* |
Choix de l'unité heures, minutes ou secondes |
pour les durées limites de session,journée et de mois |
*/ |
Choix de l'unité heures, minutes ou secondes |
pour les durées limites de session,journée et de mois |
*/ |
case 'Session-Timeout' : |
case 'Max-Daily-Session' : |
case 'Max-Monthly-Session' : |
/web/acc/manager/htdocs/images/arrow.gif |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/web/acc/manager/htdocs/images/bg.gif |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/web/acc/manager/htdocs/images/black.gif |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/web/acc/manager/htdocs/images/greenlines1.gif |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/web/acc/manager/htdocs/images/logo2.gif |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/web/acc/manager/htdocs/images/pixel.gif |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/web/acc/manager/htdocs/images/title2.gif |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/web/acc/manager/htdocs/show_groups.php |
---|
10,7 → 10,7 |
echo <<<EOM |
<html> |
<title>Find group</title> |
<meta http-equiv="Content-Type" content="text/html; charset=$config[general_charset]"> |
<meta http-equiv="Content-Type" content="text/html" charset="$config[general_charset]"> |
<link rel="stylesheet" href="/css/style.css"> |
</head> |
<body> |
21,11 → 21,11 |
EOM; |
exit(); |
} |
if ($config[general_lib_type] != 'sql'){ |
if ($config['general_lib_type'] != 'sql'){ |
echo <<<EOM |
<html> |
<title>find group</title> |
<meta http-equiv="Content-Type" content="text/html; charset=$config[general_charset]"> |
<meta http-equiv="Content-Type" content="text/html" charset="$config[general_charset]"> |
<link rel="stylesheet" href="style.css"> |
</head> |
<body> |
45,7 → 45,7 |
<body> |
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0"> |
<tr><th><?php echo "$l_groups_managment"; ?></th></tr> |
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" |
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" |
height="2"></td></tr> |
</TABLE> |
<TABLE width="100%" border=0 cellspacing=0 cellpadding=1> |
/web/acc/manager/htdocs/user_accounting.php |
---|
2,6 → 2,17 |
//gestion de la langue |
if (is_file("../lib/langues.php")) |
include("../lib/langues.php"); |
if(!isset($selected['5'])) $selected['5'] = ''; |
if(!isset($selected['10'])) $selected['10'] = ''; |
if(!isset($selected['15'])) $selected['15'] = ''; |
if(!isset($selected['20'])) $selected['20'] = ''; |
if(!isset($selected['40'])) $selected['40'] = ''; |
if(!isset($selected['80'])) $selected['80'] = ''; |
if(!isset($selected['all'])) $selected['all'] = ''; |
if(!isset($selected['asc'])) $selected['asc'] = ''; |
if(!isset($selected['desc'])) $selected['desc'] = ''; |
require('/etc/freeradius-web/config.php'); |
require('../lib/functions.php'); |
require('../lib/sql/functions.php'); |
29,20 → 40,22 |
} |
$now = time(); |
$now_str = ($now_str != '') ? "$now_str" : date($config[sql_date_format],$now + 86400); |
$prev_str = ($prev_str != '') ? "$prev_str" : date($config[sql_date_format], $now - 604800 ); |
$now_str = (isset($now_str) && $now_str != '') ? "$now_str" : date($config['sql_date_format'],$now + 86400); |
$prev_str = (isset($prev_str) && $prev_str != '') ? "$prev_str" : date($config['sql_date_format'], $now - 604800 ); |
$num = 0; |
$pagesize = ($pagesize) ? $pagesize : 10; |
$pagesize = (isset($pagesize) && $pagesize) ? $pagesize : 10; |
if (!is_numeric($pagesize) && $pagesize != 'all') |
$pagesize = 10; |
$limit = ($pagesize == 'all') ? '' : "$pagesize"; |
$selected[$pagesize] = 'selected'; |
$order = ($order != '') ? $order : $config[general_accounting_info_order]; |
$order = (isset($order) && $order != '') ? $order : $config['general_accounting_info_order']; |
if ($order != 'desc' && $order != 'asc') |
$order = 'desc'; |
$selected[$order] = 'selected'; |
$now_str = mysql_escape_string($now_str); |
$prev_str = mysql_escape_string($prev_str); |
$link = da_sql_pconnect($config); |
$now_str = da_sql_escape_string($link, $now_str); |
$prev_str = da_sql_escape_string($link, $prev_str); |
//$now_str = da_sql_escape_string($now_str); |
//$prev_str = da_sql_escape_string($prev_str); |
61,7 → 74,7 |
<body> |
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0"> |
<tr><th>$l_users_managment</th></tr> |
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" |
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" |
height="2"></td></tr> |
</TABLE> |
<TABLE width="100%" border=0 cellspacing=0 cellpadding=1> |
99,53 → 112,55 |
<td><b>#</b></td> |
<?php |
for($i=1;$i<=9;$i++){ |
if (($acct_attrs['ua']["$i"] != '') && ($acct_attrs['ua']["$i"] != 'server') && ($acct_attrs['ua']["$i"] != 'callerid')) |
if (isset($acct_attrs['ua']["$i"]) && ($acct_attrs['ua']["$i"] != '') && ($acct_attrs['ua']["$i"] != 'server') && ($acct_attrs['ua']["$i"] != 'callerid')) |
echo "<td><b>" . $acct_attrs['ua']["$i"] . "</b></td>\n"; |
} |
$sql_extra_query = ''; |
if ($config[sql_accounting_extra_query] != '') |
$sql_extra_query = xlat($config[sql_accounting_extra_query],$login,$config); |
if (isset($config['sql_accounting_extra_query']) && $config['sql_accounting_extra_query'] != '') |
$sql_extra_query = xlat($config['sql_accounting_extra_query'],$login,$config); |
?> |
</tr> |
<?php |
$link = @da_sql_pconnect($config); |
if ($link){ |
$search = @da_sql_query($link,$config, |
$search = da_sql_query($link,$config, |
"SELECT " . da_sql_limit($limit,0,$config) . " * FROM $config[sql_accounting_table] |
WHERE username = '$login' AND acctstarttime <= '$now_str' |
AND acctstarttime >= '$prev_str' $sql_extra_query " . da_sql_limit($limit,1,$config) . |
" ORDER BY acctstarttime $order " . da_sql_limit($limit,2,$config). " ;"); |
if ($search){ |
while( $row = @da_sql_fetch_array($search,$config) ){ |
$acct_sessiontime_sum = 0; |
$acct_upload_sum = 0; |
$acct_download_sum = 0; |
while( $row = da_sql_fetch_array($search,$config) ){ |
$num++; |
$acct_type = "$row[framedprotocol]/$row[nasporttype]"; |
if ($acct_type == '') |
$acct_type = '-'; |
$acct_logedin = $row[acctstarttime]; |
$acct_sessiontime = $row[acctsessiontime]; |
$acct_logedin = $row['acctstarttime']; |
$acct_sessiontime = $row['acctsessiontime']; |
$acct_sessiontime_sum += $acct_sessiontime; |
$acct_sessiontime = time2str($acct_sessiontime); |
$acct_ip = $row[framedipaddress]; |
$acct_ip = $row['framedipaddress']; |
if ($acct_ip == '') |
$acct_ip = '-'; |
$acct_upload = $row[acctinputoctets]; |
$acct_upload = $row['acctinputoctets']; |
$acct_upload_sum += $acct_upload; |
$acct_upload = bytes2str($acct_upload); |
$acct_download = $row[acctoutputoctets]; |
$acct_download = $row['acctoutputoctets']; |
$acct_download_sum += $acct_download; |
$acct_download = bytes2str($acct_download); |
$acct_server = $row[nasipaddress]; |
$acct_server = $row['nasipaddress']; |
if ($acct_server != ''){ |
$acct_server = $da_name_cache[$row[nasipaddress]]; |
$acct_server = (isset($da_name_cache)) ? $da_name_cache[$row['nasipaddress']] : null; |
if (!isset($acct_server)){ |
$acct_server = @gethostbyaddr($row[nasipaddress]); |
if (!isset($da_name_cache) && $config[general_use_session] == 'yes'){ |
$da_name_cache[$row[nasipaddress]] = $acct_server; |
$acct_server = gethostbyaddr($row['nasipaddress']); |
if (!isset($da_name_cache) && $config['general_use_session'] == 'yes'){ |
$da_name_cache[$row['nasipaddress']] = $acct_server; |
session_register('da_name_cache'); |
} |
else |
$da_name_cache[$row[nasipaddress]] = $acct_server; |
$da_name_cache[$row['nasipaddress']] = $acct_server; |
} |
} |
else |
154,29 → 169,29 |
$acct_terminate_cause = "$row[acctterminatecause]"; |
if ($acct_terminate_cause == '') |
$acct_terminate_cause = '-'; |
if (ereg('Login-Incorrect',$acct_terminate_cause) || |
ereg('Multiple-Logins', $acct_terminate_cause) || ereg('Invalid-User',$acct_terminate_cause)) |
if (preg_match('/Login-Incorrect/',$acct_terminate_cause) || |
preg_match('/Multiple-Logins/', $acct_terminate_cause) || preg_match('/Invalid-User/',$acct_terminate_cause)) |
$acct_callerid = "$row[callingstationid]"; |
if ($acct_callerid == '') |
if (!isset($acct_callerid) || $acct_callerid == '') |
$acct_callerid = '-'; |
echo <<<EOM |
<tr align=center> |
<td>$num</td> |
EOM; |
if ($acct_attrs[ua][1] != '') echo "<td>$acct_type</td>\n"; |
if ($acct_attrs[ua][2] != '') echo "<td>$acct_logedin</td>\n"; |
if ($acct_attrs[ua][3] != '') echo "<td>$acct_sessiontime</td>\n"; |
if ($acct_attrs[ua][4] != '') echo "<td>$acct_ip</td>\n"; |
if ($acct_attrs[ua][5] != '') echo "<td>$acct_upload</td>\n"; |
if ($acct_attrs[ua][6] != '') echo "<td>$acct_download</td>\n"; |
// if ($acct_attrs[ua][7] != '') echo "<td>$acct_server</td>\n"; |
if ($acct_attrs[ua][8] != '') echo "<td>$acct_terminate_cause</td>\n"; |
// if ($acct_attrs[ua][9] != '') echo "<td>$acct_callerid</td>\n"; |
if (isset($acct_attrs['ua'][1]) && $acct_attrs['ua'][1] != '') echo "<td>$acct_type</td>\n"; |
if (isset($acct_attrs['ua'][2]) && $acct_attrs['ua'][2] != '') echo "<td>$acct_logedin</td>\n"; |
if (isset($acct_attrs['ua'][3]) && $acct_attrs['ua'][3] != '') echo "<td>$acct_sessiontime</td>\n"; |
if (isset($acct_attrs['ua'][4]) && $acct_attrs['ua'][4] != '') echo "<td>$acct_ip</td>\n"; |
if (isset($acct_attrs['ua'][5]) && $acct_attrs['ua'][5] != '') echo "<td>$acct_upload</td>\n"; |
if (isset($acct_attrs['ua'][6]) && $acct_attrs['ua'][6] != '') echo "<td>$acct_download</td>\n"; |
// if (isset($acct_attrs['ua'][7]) && $acct_attrs[ua][7] != '') echo "<td>$acct_server</td>\n"; |
if (isset($acct_attrs['ua'][8]) && $acct_attrs['ua'][8] != '') echo "<td>$acct_terminate_cause</td>\n"; |
// if (isset($acct_attrs['ua'][9]) && $acct_attrs[ua][9] != '') echo "<td>$acct_callerid</td>\n"; |
echo "</tr>\n"; |
} |
$acct_sessiontime_sum = time2str($acct_sessiontime_sum); |
$acct_upload_sum = bytes2str($acct_upload_sum); |
$acct_download_sum = bytes2str($acct_download_sum); |
$acct_sessiontime_sum = (isset($acct_sessiontime_sum)) ? time2str($acct_sessiontime_sum) : "0 seconds"; |
$acct_upload_sum = (isset($acct_upload_sum)) ? bytes2str($acct_upload_sum) : "0.00 KBs"; |
$acct_download_sum = (isset($acct_download_sum)) ? bytes2str($acct_download_sum) : "0.00 KBs"; |
} |
else |
echo "<b>Database query failed: " . da_sql_error($link,$config) . "</b><br>\n"; |
184,21 → 199,21 |
else |
echo "<b>Could not connect to SQL database</b><br>\n"; |
$colspan = 3; |
if ($acct_attrs[ua][1] == '') |
$colspan--; |
if ($acct_attrs[ua][2] == '') |
$colspan--; |
if (!isset($acct_attrs['ua'][1]) || $acct_attrs['ua'][1] == ''){ |
$colspan--;} |
if (!isset($acct_attrs['ua'][2]) || $acct_attrs['ua'][2] == ''){ |
$colspan--;} |
echo <<<EOM |
<tr bgcolor="lightyellow" align="center"> |
<td colspan=$colspan><b>Total</b></td> |
EOM; |
if ($acct_attrs[ua][3] != '') echo "<td><b>$acct_sessiontime_sum</b></td>\n"; |
if ($acct_attrs[ua][4] != '') echo "<td> </td>\n"; |
if ($acct_attrs[ua][5] != '') echo "<td><b>$acct_upload_sum</b></td>\n"; |
if ($acct_attrs[ua][6] != '') echo "<td><b>$acct_download_sum</b></td>\n"; |
// if ($acct_attrs[ua][7] != '') echo "<td> </td>\n"; |
if ($acct_attrs[ua][8] != '') echo "<td> </td>\n"; |
// if ($acct_attrs[ua][9] != '') echo "<td> </td>\n"; |
if (isset($acct_attrs['ua'][3]) && $acct_attrs['ua'][3] != '') echo "<td><b>$acct_sessiontime_sum</b></td>\n"; |
if (isset($acct_attrs['ua'][4]) && $acct_attrs['ua'][4] != '') echo "<td> </td>\n"; |
if (isset($acct_attrs['ua'][5]) && $acct_attrs['ua'][5] != '') echo "<td><b>$acct_upload_sum</b></td>\n"; |
if (isset($acct_attrs['ua'][6]) && $acct_attrs['ua'][6] != '') echo "<td><b>$acct_download_sum</b></td>\n"; |
// if (isset($acct_attrs['ua'][7]) && $acct_attrs['ua'][7] != '') echo "<td> </td>\n"; |
if (isset($acct_attrs['ua'][8]) && $acct_attrs['ua'][8] != '') echo "<td> </td>\n"; |
// if (isset($acct_attrs['ua'][9]) && $acct_attrs['ua'][9] != '') echo "<td> </td>\n"; |
?> |
</tr> |
</table> |
/web/acc/manager/htdocs/user_admin.php |
---|
51,16 → 51,51 |
exit(); |
} |
$monthly_limit = ($item_vals['Max-Monthly-Session'][0] != '') ? $item_vals['Max-Monthly-Session'][0] : $default_vals['Max-Monthly-Session'][0]; |
$monthly_limit = ($monthly_limit) ? $monthly_limit : $config[counter_default_monthly]; |
$weekly_limit = ($item_vals['Max-Weekly-Session'][0] != '') ? $item_vals['Max-Weekly-Session'][0] : $default_vals['Max-Weekly-Session'][0]; |
$weekly_limit = ($weekly_limit) ? $weekly_limit : $config[counter_default_weekly]; |
$daily_limit = ($item_vals['Max-Daily-Session'][0] != '') ? $item_vals['Max-Daily-Session'][0] : $default_vals['Max-Daily-Session'][0]; |
$daily_limit = ($daily_limit) ? $daily_limit : $config[counter_default_daily]; |
$session_limit = ($item_vals['Session-Timeout'][0] != '') ? $item_vals['Session-Timeout'][0] : $default_vals['Session-Timeout'][0]; |
if(isset($item_vals['Max-Monthly-Session'][0]) && $item_vals['Max-Monthly-Session'][0] != ''){ |
$monthly_limit = $item_vals['Max-Monthly-Session'][0]; |
} else if (isset($default_vals['Max-Monthly-Session'][0])){ |
$monthly_limit = $default_vals['Max-Monthly-Session'][0]; |
} else { |
$monthly_limit = ''; |
} |
$monthly_limit = ($monthly_limit) ? $monthly_limit : $config['counter_default_monthly']; |
if(isset($item_vals['Max-Weekly-Session'][0]) && $item_vals['Max-Weekly-Session'][0] != ''){ |
$weekly_limit = $item_vals['Max-Weekly-Session'][0]; |
} else if (isset($default_vals['Max-Weekly-Session'][0])){ |
$weekly_limit = $default_vals['Max-Weekly-Session'][0]; |
} else { |
$weekly_limit = ''; |
} |
$weekly_limit = ($weekly_limit) ? $weekly_limit : $config['counter_default_weekly']; |
if(isset($item_vals['Max-Daily-Session'][0]) && $item_vals['Max-Daily-Session'][0] != ''){ |
$daily_limit = $item_vals['Max-Daily-Session'][0]; |
} else if (isset($default_vals['Max-Daily-Session'][0])){ |
$daily_limit = $default_vals['Max-Daily-Session'][0]; |
} else { |
$daily_limit = ''; |
} |
$daily_limit = ($daily_limit) ? $daily_limit : $config['counter_default_daily']; |
if(isset($item_vals['Session-Timeout'][0]) && $item_vals['Session-Timeout'][0] != ''){ |
$session_limit = $item_vals['Session-Timeout'][0]; |
} else if (isset($default_vals['Session-Timeout'][0])){ |
$session_limit = $default_vals['Session-Timeout'][0]; |
} else { |
$session_limit = ''; |
} |
$session_limit = ($session_limit) ? $session_limit : 'none'; |
$total_limit = ($item_vals['Max-All-Session'][0] != '') ? $item_vals['Max-All-Session'][0] : $default_vals['Max-All-Session'][0]; |
if(isset($item_vals['Max-All-Session'][0]) && $item_vals['Max-All-Session'][0] != ''){ |
$total_limit = $item_vals['Max-All-Session'][0]; |
} else if (isset($default_vals['Max-All-Session'][0])){ |
$total_limit = $default_vals['Max-All-Session'][0]; |
} else { |
$total_limit = ''; |
} |
$total_limit = ($total_limit) ? $total_limit : 'none'; |
$remaining = 'unlimited time'; |
$log_color = 'green'; |
69,12 → 104,12 |
$now_str = date("$config[sql_date_format]",$now + 86400); |
$week_str = date("$config[sql_date_format]",$week); |
$day = date('w'); |
$week_start = date($config[sql_date_format],$now - ($day)*86400); |
$month_start = date($config[sql_date_format],$now - date('j')*86400); |
$week_start = date($config['sql_date_format'],$now - ($day)*86400); |
$month_start = date($config['sql_date_format'],$now - date('j')*86400); |
$today = $day; |
$now_tmp = $now; |
for ($i = $day; $i >-1; $i--){ |
$days[$i] = date($config[sql_date_format],$now_tmp); |
$days[$i] = date($config['sql_date_format'],$now_tmp); |
$now_tmp -= 86400; |
} |
$day++; |
82,7 → 117,7 |
$now -= 604800; |
$now += 86400; |
for ($i = $day; $i <= 6; $i++){ |
$days[$i] = date($config[sql_date_format],$now); |
$days[$i] = date($config['sql_date_format'],$now); |
// $now -= 86400; |
$now += 86400; |
} |
91,9 → 126,9 |
$extra_msg = ''; |
$used = array('-','-','-','-','-','-','-'); |
$link = @da_sql_pconnect($config); |
$link = da_sql_pconnect($config); |
if ($link){ |
$search = @da_sql_query($link,$config, |
$search = da_sql_query($link,$config, |
"SELECT sum(acctsessiontime) AS sum_sess_time, |
sum(acctinputoctets) AS sum_in_octets, |
sum(acctoutputoctets) AS sum_out_octets, |
104,38 → 139,38 |
$config[sql_accounting_table] WHERE username = '$login' |
AND acctstarttime >= '$week_str' AND acctstarttime <= '$now_str';"); |
if ($search){ |
$row = @da_sql_fetch_array($search,$config); |
$tot_time = time2str($row[sum_sess_time]); |
$tot_input = bytes2str($row[sum_in_octets]); |
$tot_output = bytes2str($row[sum_out_octets]); |
$avg_time = time2str($row[avg_sess_time]); |
$avg_input = bytes2str($row[avg_in_octets]); |
$avg_output = bytes2str($row[avg_out_octets]); |
$tot_conns = $row[counter]; |
$row = da_sql_fetch_array($search,$config); |
$tot_time = time2str($row['sum_sess_time']); |
$tot_input = bytes2str($row['sum_in_octets']); |
$tot_output = bytes2str($row['sum_out_octets']); |
$avg_time = time2str($row['avg_sess_time']); |
$avg_input = bytes2str($row['avg_in_octets']); |
$avg_output = bytes2str($row['avg_out_octets']); |
$tot_conns = $row['counter']; |
} |
else |
echo "<b>Database query failed: " . da_sql_error($link,$config) . "</b><br>\n"; |
$search = @da_sql_query($link,$config, |
$search = da_sql_query($link,$config, |
"SELECT sum(acctsessiontime) AS sum_sess_time FROM $config[sql_accounting_table] WHERE username = '$login' |
AND acctstarttime >= '$week_start' AND acctstarttime <= '$now_str';"); |
if ($search){ |
$row = @da_sql_fetch_array($search,$config); |
$weekly_used = $row[sum_sess_time]; |
$row = da_sql_fetch_array($search,$config); |
$weekly_used = $row['sum_sess_time']; |
} |
else |
echo "<b>Database query failed: " . da_sql_error($link,$config) . "</b><br>\n"; |
if ($monthly_limit != 'none' || $config[counter_monthly_calculate_usage] == 'true'){ |
$search = @da_sql_query($link,$config, |
if ($monthly_limit != 'none' || (isset($config['counter_monthly_calculate_usage']) && $config['counter_monthly_calculate_usage'] == 'true')){ |
$search = da_sql_query($link,$config, |
"SELECT sum(acctsessiontime) AS sum_sess_time FROM $config[sql_accounting_table] WHERE username = '$login' |
AND acctstarttime >= '$month_start' AND acctstarttime <= '$now_str';"); |
if ($search){ |
$row = @da_sql_fetch_array($search,$config); |
$monthly_used = $row[sum_sess_time]; |
$row = da_sql_fetch_array($search,$config); |
$monthly_used = $row['sum_sess_time']; |
} |
else |
echo "<b>Database query failed: " . da_sql_error($link,$config) . "</b><br>\n"; |
} |
$search = @da_sql_query($link,$config, |
$search = da_sql_query($link,$config, |
"SELECT COUNT(*) AS counter FROM $config[sql_accounting_table] WHERE username = '$login' |
AND acctstoptime >= '$week_str' AND acctstoptime <= '$now_str' |
AND (acctterminatecause LIKE 'Login-Incorrect%' OR |
142,8 → 177,8 |
acctterminatecause LIKE 'Invalid-User%' OR |
acctterminatecause LIKE 'Multiple-Logins%');"); |
if ($search){ |
$row = @da_sql_fetch_array($search,$config); |
$tot_badlogins = $row[counter]; |
$row = da_sql_fetch_array($search,$config); |
$tot_badlogins = $row['counter']; |
} |
else |
echo "<b>Database query failed: " . da_sql_error($link,$config) . "</b><br>\n"; |
150,19 → 185,19 |
for($i = 0; $i <=6; $i++){ |
if ($days[$i] == '') |
continue; |
$search = @da_sql_query($link,$config, |
$search = da_sql_query($link,$config, |
"SELECT sum(acctsessiontime) AS sum_sess_time FROM $config[sql_accounting_table] WHERE |
username = '$login' AND acctstoptime >= '$days[$i] 00:00:00' |
AND acctstoptime <= '$days[$i] 23:59:59';"); |
if ($search){ |
$row = @da_sql_fetch_array($search,$config); |
$used[$i] = $row[sum_sess_time]; |
$row = da_sql_fetch_array($search,$config); |
$used[$i] = $row['sum_sess_time']; |
if ($daily_limit != 'none' && $used[$i] > $daily_limit) |
$used[$i] = "<font color=red>" . time2str($used[$i]) . "</font>"; |
else |
$used[$i] = time2str($used[$i]); |
if ($today == $i){ |
$daily_used = $row[sum_sess_time]; |
$daily_used = $row['sum_sess_time']; |
if ($daily_limit != 'none'){ |
$remaining = $daily_limit - $daily_used; |
if ($remaining <=0) |
207,7 → 242,7 |
$remaining = $tmp; |
$log_color = ($remaining) ? 'green' : 'red'; |
} |
if ($monthly_limit != 'none' || $config[counter_monthly_calculate_usage] == 'true'){ |
if ($monthly_limit != 'none' || (isset($config['counter_monthly_calculate_usage']) && $config['counter_monthly_calculate_usage'] == 'true')){ |
$monthly_used = time2str($monthly_used); |
if ($monthly_limit != 'none' && !$tmp) |
$monthly_used = "<font color=red>$monthly_used</font>"; |
219,14 → 254,14 |
$remaining = $session_limit; |
} |
$search = @da_sql_query($link,$config, |
$search = da_sql_query($link,$config, |
"SELECT " . da_sql_limit(1,0,$config) . " * FROM $config[sql_accounting_table] |
WHERE username = '$login' AND acctstoptime IS NULL " . da_sql_limit(1,1,$config) . " |
ORDER BY acctstarttime DESC " . da_sql_limit(1,2,$config). " ;"); |
if ($search){ |
if (@da_sql_num_rows($search,$config)){ |
if (da_sql_num_rows($search,$config)){ |
$logged_now = 1; |
$row = @da_sql_fetch_array($search,$config); |
$row = da_sql_fetch_array($search,$config); |
$lastlog_time = $row['acctstarttime']; |
$lastlog_server_ip = $row['nasipaddress']; |
$lastlog_server_port = $row['nasportid']; |
235,11 → 270,11 |
$remaining = $remaining - $lastlog_session_time; |
if ($remaining < 0) |
$remaining = 0; |
$log_color = ($remaining) ? 'green' : 'red'; |
$log_color = ($remaining) ? 'green' : 'red'; |
} |
$lastlog_session_time_jvs = 1000 * $lastlog_session_time; |
$lastlog_session_time = time2strclock($lastlog_session_time); |
$lastlog_client_ip = $row['framedipaddress']; |
$lastlog_client_ip = $row['framedipaddress']; |
$lastlog_server_name = @gethostbyaddr($lastlog_server_ip); |
$lastlog_client_name = @gethostbyaddr($lastlog_client_ip); |
$lastlog_callerid = $row['callingstationid']; |
259,19 → 294,19 |
} |
else |
echo "<b>Database query failed: " . da_sql_error($link,$config) . "</b><br>\n"; |
if (! $logged_now){ |
$search = @da_sql_query($link,$config, |
if (!isset($logged_now) || !$logged_now){ |
$search = da_sql_query($link,$config, |
"SELECT " . da_sql_limit(1,0,$config) . " * FROM $config[sql_accounting_table] |
WHERE username = '$login' AND acctsessiontime != '0' " . da_sql_limit(1,1,$config) . " |
ORDER BY acctstoptime DESC " . da_sql_limit(1,2,$config). " ;"); |
if ($search){ |
if (@da_sql_num_rows($search,$config)){ |
$row = @da_sql_fetch_array($search,$config); |
if (da_sql_num_rows($search,$config)){ |
$row = da_sql_fetch_array($search,$config); |
$lastlog_time = $row['acctstarttime']; |
$lastlog_server_ip = $row['nasipaddress']; |
$lastlog_server_port = $row['nasportid']; |
$lastlog_session_time = time2str($row['acctsessiontime']); |
$lastlog_client_ip = $row['framedipaddress']; |
$lastlog_client_ip = $row['framedipaddress']; |
$lastlog_server_name = ($lastlog_server_ip != '') ? @gethostbyaddr($lastlog_server_ip) : '-'; |
$lastlog_client_name = ($lastlog_client_ip != '') ? @gethostbyaddr($lastlog_client_ip) : '-'; |
$lastlog_callerid = $row['callingstationid']; |
307,7 → 342,7 |
$msg =<<<EON |
$l_user_remain_login<font color="$log_color"> <b>$remaining $extra_msg</b></font> |
EON; |
$lock_msg = $item_vals['Dialup-Lock-Msg'][0]; |
$lock_msg = (isset($item_vals['Dialup-Lock-Msg'][0])) ? $item_vals['Dialup-Lock-Msg'][0] : ''; |
if ($lock_msg != '') |
$descr =<<<EON |
<font color=red><b>$lock_msg </b</font> |
315,7 → 350,7 |
else |
$descr = '-'; |
$expiration = $default_vals['Expiration'][0]; |
$expiration = isset($default_vals['Expiration'][0]) ? $default_vals['Expiration'][0] : ''; |
if ($item_vals['Expiration'][0] != '') |
$expiration = $item_vals['Expiration'][0]; |
if ($expiration != ''){ |
/web/acc/manager/htdocs/user_delete.php |
---|
3,6 → 3,7 |
if (is_file("../lib/langues.php")) |
include("../lib/langues.php"); |
require('/etc/freeradius-web/config.php'); |
if (!isset($type)) $type = 'user'; |
if ($type != 'group'){ |
if (is_file("../lib/$config[general_lib_type]/user_info.php")) |
include("../lib/$config[general_lib_type]/user_info.php"); |
19,6 → 20,9 |
<head> |
EOM; |
if (!isset($user_type)) $user_type = 'user'; |
if (!isset($delete_user)) $delete_user = 0; |
if ($user_type != 'group'){ |
$util = $l_user; |
$title = $l_users_managment;} |
34,7 → 38,7 |
<body> |
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0"> |
<tr><th>$title</th></tr> |
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" |
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" |
height="2"></td></tr> |
</TABLE> |
<TABLE width="100%" border=0 cellspacing=0 cellpadding=1> |
68,7 → 72,7 |
<table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top> |
<tr><td> |
EOM; |
if ($delete_user == 1){ |
if ($user_type != 'group'){ |
if (is_file("../lib/$config[general_lib_type]/delete_user.php")) |
75,7 → 79,7 |
include("../lib/$config[general_lib_type]/delete_user.php"); |
} |
else{ |
if ($delete_users_of_group == 1){ |
if (isset($delete_users_of_group) && $delete_users_of_group == 1){ |
unset($group_members); |
$tmp_group_name=$login; |
if (is_file("../lib/$config[general_lib_type]/group_info.php")){ |
/web/acc/manager/htdocs/user_edit.php |
---|
5,10 → 5,16 |
require('/etc/freeradius-web/config.php'); |
require('../lib/attrshow.php'); |
require('../lib/defaults.php'); |
if(!isset($change)) $change = 0; |
if(!isset($user_type)) $user_type = 'user'; |
if(!isset($badusers)) $badusers = 0; |
if(!isset($cn)) $cn = ''; |
if ($user_type != 'group'){ |
if (is_file("../lib/$config[general_lib_type]/user_info.php")) |
include("../lib/$config[general_lib_type]/user_info.php"); |
if ($config[general_lib_type] == 'sql' && $config[sql_show_all_groups] == 'true'){ |
if ($config['general_lib_type'] == 'sql' && $config['sql_show_all_groups'] == 'true'){ |
$saved_login = $login; |
$login = ''; |
if (is_file("../lib/sql/group_info.php")) |
20,7 → 26,7 |
if (is_file("../lib/$config[general_lib_type]/group_info.php")) |
include("../lib/$config[general_lib_type]/group_info.php"); |
} |
if ($config[general_lib_type] == 'sql' && $config[sql_use_operators] == 'true'){ |
if ($config['general_lib_type'] == 'sql' && $config['sql_use_operators'] == 'true'){ |
$colspan=2; |
$show_ops = 1; |
include("../lib/operators.php"); |
33,7 → 39,7 |
<html> |
<head> |
<title>Users & groups edition</title> |
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $config[general_charset]?>"> |
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $config['general_charset']?>"> |
<link rel="stylesheet" href="/css/style.css"> |
<script language="javascript" type="text/javascript"> |
var chars='0123456789abcdefghijkmnopqrstuvwxyzABCDEFGHIJKLMNPQRSTUVWXYZ' |
51,7 → 57,7 |
<script type="text/javascript" src="/js/epoch_classes.js"></script> |
<script language="javascript" type="text/javascript"> |
/*Insertion du calendrier */ |
var dp_cal; |
var dp_cal; |
window.onload = function () { |
dp_cal = new Epoch('epoch_popup','popup',document.getElementById('popup_container')); |
}; |
62,10 → 68,10 |
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0"> |
<tr><th> |
<?php |
if ($user_type != 'group'){ echo "$l_users_managment";} else{ echo "$l_groups_managment";} |
if($user_type != 'group'){ echo "$l_users_managment";} else{ echo "$l_groups_managment";} |
?> |
</th></tr> |
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" |
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" |
height="2"></td></tr> |
</TABLE> |
<TABLE width="100%" border=1 cellspacing=0 cellpadding=1> |
73,16 → 79,13 |
<center> |
<table border=0 width=640 cellpadding=0 cellspacing=2> |
<?php |
if ($user_type != 'group') |
{ |
if ($user_type != 'group'){ |
include("../html/user_toolbar.html.php"); |
$titre=$l_user; |
} |
else |
{ |
}else{ |
include("../html/group_toolbar.html.php"); |
$titre=$l_group; |
} |
} |
print <<<EOM |
</table> |
<br> |
100,17 → 103,17 |
<table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top> |
<tr><td> |
EOM; |
if ($change == 1){ |
if (is_file("../lib/$config[general_lib_type]/change_attrs.php")) |
include("../lib/$config[general_lib_type]/change_attrs.php"); |
if ($user_type != 'group'){ |
if ($config[general_show_user_password] != 'no' && $passwd != '' |
if ($config['general_show_user_password'] != 'no' && $passwd != '' |
&& is_file("../lib/$config[general_lib_type]/change_passwd.php")) |
include("../lib/$config[general_lib_type]/change_passwd.php"); |
if (is_file("../lib/$config[general_lib_type]/user_info.php")) |
include("../lib/$config[general_lib_type]/user_info.php"); |
if ($group_change && $config[general_lib_type] == 'sql' && $config[sql_show_all_groups] == 'true'){ |
if ($group_change && $config['general_lib_type'] == 'sql' && $config['sql_show_all_groups'] == 'true'){ |
include("../lib/sql/group_change.php"); |
include("../lib/defaults.php"); |
} |
134,7 → 137,7 |
if (is_file("../lib/add_badusers.php")) |
include("../lib/add_badusers.php"); |
} |
?> |
<form name="edituser" method=post> |
<input type=hidden name=login value=<?php print $login ?>> |
145,7 → 148,7 |
<input type=hidden name=group_change value="0"> |
<table border=1 bordercolordark=#ffffe0 bordercolorlight=#000000 width=100% cellpadding=2 cellspacing=0 bgcolor="#ffffe0" valign=top> |
<?php |
if ($user_type != 'group' && $config[general_show_user_password] != 'no'){ |
if ($user_type != 'group' && $config['general_show_user_password'] != 'no'){ |
echo <<<EOM |
<tr> |
<td align=right colspan=$colspan bgcolor="#d0ddb0"> |
163,7 → 166,7 |
} |
foreach($show_attrs as $key => $desc){ |
$name = $attrmap["$key"]; |
$generic = $attrmap[generic]["$key"]; |
$generic = (isset($attrmap['generic']["$key"])) ? $attrmap['generic']["$key"] : ''; |
if ($name == 'none') |
continue; |
unset($vals); |
170,17 → 173,17 |
unset($selected); |
unset($ops); |
$def_added = 0; |
if ($item_vals["$key"][count]){ |
for($i=0;$i<$item_vals["$key"][count];$i++){ |
if (isset($item_vals["$key"]['count']) && $item_vals["$key"]['count']){ |
for($i=0;$i<$item_vals["$key"]['count'];$i++){ |
$vals[] = $item_vals["$key"][$i]; |
$ops[] = $item_vals["$key"][operator][$i]; |
$ops[] = $item_vals["$key"]['operator'][$i]; |
} |
} |
else{ |
if ($default_vals["$key"][count]){ |
for($i=0;$i<$default_vals["$key"][count];$i++){ |
if (isset($default_vals["$key"]['count']) && $default_vals["$key"]['count']){ |
for($i=0;$i<$default_vals["$key"]['count'];$i++){ |
$vals[] = $default_vals["$key"][$i]; |
$ops[] = $default_vals["$key"][operator][$i]; |
$ops[] = $default_vals["$key"]['operator'][$i]; |
} |
} |
else{ |
190,20 → 193,20 |
$def_added = 1; |
} |
if ($generic == 'generic' && $def_added == 0){ |
for($i=0;$i<$default_vals["$key"][count];$i++){ |
for($i=0;$i<$default_vals["$key"]['count'];$i++){ |
$vals[] = $default_vals["$key"][$i]; |
$ops[] = $default_vals["$key"][operator][$i]; |
$ops[] = $default_vals["$key"]['operator'][$i]; |
} |
} |
if ($add && $name == $add_attr){ |
} |
if (isset($add) && $add && $name == $add_attr){ |
$vals[] = $default_vals["$key"][0]; |
$ops[] = ($default_vals["$key"][operator][0] != '') ? $default_vals["$key"][operator][0] : '='; |
$ops[] = ($default_vals["$key"]['operator'][0] != '') ? $default_vals["$key"]['operator'][0] : '='; |
} |
$i = 0; |
foreach($vals as $val){ |
$name1 = $name . $i; |
$val = ereg_replace('"','"',$val); |
$val = preg_replace('/\"/','"',$val); |
$oper_name = $name1 . '_op'; |
$oper = $ops[$i]; |
$selected[$oper] = 'selected'; |
210,8 → 213,8 |
$i++; |
switch ($key) |
{ |
// $advanced = 1 : champs de saisie amélioré (calendrier, convertisseur, etc.) |
case 'Simultaneous-Use' : |
// $advanced = 1 : champs de saisie amélioré (calendrier, convertisseur, etc.) |
case 'Simultaneous-Use' : |
$advanced=1; |
$help_link="help/simultaneous_use_help.html"; |
$desc=$l_simultaneous_use; |
221,7 → 224,7 |
$help_link="help/max_all_session_help.html"; |
$desc=$l_max_all_session; |
break; |
case 'Session-Timeout' : |
case 'Session-Timeout' : |
$advanced=1; |
$help_link="help/session_timeout_help.html"; |
$desc=$l_session_timeout; |
236,7 → 239,7 |
$help_link="help/session_timeout_help.html"; |
$desc=$l_monthly_timeout; |
break; |
case 'Login-Time' : |
case 'Login-Time' : |
$advanced=1; |
$help_link="help/login_time_help.html"; |
$desc=$l_login_time; |
291,12 → 294,13 |
<a href="$help_link" target=help onclick=window.open("$help_link","help","width=600,height=250,toolbar=no,scrollbars=no,resizable=yes") title="$l_click_for_help"><font color="blue">$desc</font></a> |
EOM; |
if ($show_ops){ |
if(!isset($selected[$op_eq])) $selected[$op_eq] = ''; |
switch ($key) |
{ |
case 'Simultaneous-Use' : |
case 'Simultaneous-Use' : |
echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20></td>"; |
break; |
case 'Login-Time' : |
case 'Login-Time' : |
echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20></td>"; |
break; |
case 'Expiration' : |
395,7 → 399,7 |
EOM; |
if (isset($member_groups)){ |
echo "<select size=5 name=\"edited_groups[]\" multiple OnChange=\"this.form.group_change.value=1\">"; |
if ($config[sql_show_all_groups] == 'true'){ |
if ($config['sql_show_all_groups'] == 'true'){ |
foreach ($existing_groups as $group => $count){ |
if ($member_groups[$group] == $group) |
echo "<option selected value=\"$group\">$group\n"; |
411,7 → 415,7 |
else{ |
echo "aucun group</td></tr>"; |
} |
} |
} |
echo "</table><br>"; |
echo "<input type=submit class=button value=$l_change OnClick=\"this.form.change.value=1\">"; |
//if ($user_type != 'group'){ |
/web/acc/manager/htdocs/user_info.php |
---|
3,11 → 3,12 |
if (is_file("../lib/langues.php")) |
include("../lib/langues.php"); |
require('/etc/freeradius-web/config.php'); |
if(!isset($change)) $change = 0; |
?> |
<html> |
<head> |
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $config[general_charset]?>"> |
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $config['general_charset']?>"> |
<title>User personal information</title> |
<link rel="stylesheet" href="/css/style.css"> |
</head> |
14,7 → 15,7 |
<body> |
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0"> |
<tr><th><?php echo "$l_users_managment";?></th></tr> |
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" |
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" |
height="2"></td></tr> |
</TABLE> |
<TABLE width="100%" border=0 cellspacing=0 cellpadding=1> |
54,7 → 55,7 |
<tr bgcolor="black" valign=top><td colspan=2> |
<table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top> |
<tr><td> |
<form method=post> |
<input type=hidden name=login value="<?php echo $login?>"> |
<input type=hidden name=change value="0"> |
/web/acc/manager/htdocs/user_new.php |
---|
1,12 → 1,17 |
<?php |
<?php |
if (!isset ($create)) { $create=0; } |
if (!isset ($show)) { $show=0; } |
if (!isset ($create)) $create=0; |
if (!isset ($show)) $show=0; |
// ticket d'impression (thank's to Geoffroy MUSITELLI) |
//gestion de la langue |
if (is_file("../lib/langues.php")) |
include("../lib/langues.php"); |
if(!isset($login)) $login = ''; |
if(!isset($cn)) $cn = ''; |
if(!isset($mail)) $mail = ''; |
if(!isset($langue_imp)) $langue_imp = ''; |
require('/etc/freeradius-web/config.php'); |
if($show == 2) |
{ |
15,7 → 20,7 |
} |
require('../lib/attrshow.php'); |
require('../lib/defaults.php'); |
if ($config[general_lib_type] == 'sql' && $config[sql_use_operators] == 'true'){ |
if ($config['general_lib_type'] == 'sql' && $config['sql_use_operators'] == 'true'){ |
$colspan=2; |
$show_ops=1; |
}else{ |
24,7 → 29,7 |
} |
?> |
<html><head><title>Voucher creation</title> |
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $config[general_charset]?>"> |
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $config['general_charset']?>"> |
<link rel="stylesheet" href="/css/style.css"> |
<link rel="stylesheet" type="text/css" href="/css/epoch_styles.css" /> |
<script type="text/javascript" src="/js/epoch_classes.js"></script> |
32,7 → 37,7 |
<script language="javascript" type="text/javascript"> |
/*Insertion du calendrier */ |
var dp_cal; |
var dp_cal; |
window.onload = function () { |
dp_cal = new Epoch('epoch_popup','popup',document.getElementById('popup_container')); |
}; |
60,11 → 65,12 |
</td></tr> |
<tr bgcolor="black" valign=top><td colspan=2> |
<table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top> |
<tr><td> |
<?php |
<tr><td> |
<?php |
function sec_imp($time) |
/* Formatage des secondes avant l'impression */ |
{ |
/* Formatage des secondes avant l'impression */ |
{ |
$result = ''; |
$jour = 0;$heure = 0;$minute = 0;$seconde = 0; |
$jour = floor($time/86400); |
$reste = $time%86400; |
77,7 → 83,7 |
$seconde = $reste%60; |
if ($seconde!=0) $result = $result.$seconde.' s '; |
return $result; |
} |
} |
if ($create == 1){ |
if (is_file("../lib/$config[general_lib_type]/user_info.php")) |
92,7 → 98,7 |
include("../lib/$config[general_lib_type]/create_user.php"); |
/* Petit traitement pré-impression pour la lisibilité */ |
/* Récupération des attributs du groupe le cas échéant */ |
if ($group!=''){ |
if (isset($group) && $group!=''){ |
$saved_login = $login; |
$login = $group; |
if (is_file("../lib/sql/group_info.php")) |
103,7 → 109,7 |
if ($sto_imp==''){ $sto_imp='-';} |
else { $sto_imp=sec_imp($sto_imp);} |
if ($mas_imp==''){ $mas_imp='-';} |
else { $mas_imp=sec_imp($mas_imp);} |
else { $mas_imp=sec_imp($mas_imp);} |
if ($mds_imp==''){ $mds_imp='-';} |
else { $mds_imp=sec_imp($mds_imp);} |
if ($mms_imp==''){ $mms_imp='-';} |
110,9 → 116,9 |
else { $mms_imp=sec_imp($mms_imp);} |
/*Formatage de la date afin d'être lisible dans toute les langues 'jj mm yyyy'*/ |
if ($Expiration!=''){ $Expiration=date("d - m - Y",strtotime($Expiration));} |
else { $Expiration=$v_without;} |
else { $Expiration='-';} |
if ($show != 3) //utilisateur normal |
{ |
{ |
//Appel du ticket d'impression , passage en paramètres des valeurs à afficher |
echo' <form name="impression" method="post" action="ticket_user.php" target=_blank> |
<input type="hidden" name="langue_imp" value="'.$langue_imp.'"> |
142,7 → 148,7 |
<input type=hidden name=show value="0"> |
<input type=hidden name=langue_imp value='fr'> |
<table border=1 bordercolordark=#ffffe0 bordercolorlight=#000000 width=100% cellpadding=2 cellspacing=0 bgcolor="#ffffe0" valign=top> |
<?php |
<?php |
if($create==0){ |
echo <<<EOM |
<tr> |
162,7 → 168,7 |
</td> |
</tr> |
EOM; |
if ($config[general_lib_type] == 'sql'){ |
if ($config['general_lib_type'] == 'sql'){ |
if (isset($member_groups)) |
$selected[$member_groups[0]] = 'selected'; |
echo <<<EOM |
182,8 → 188,8 |
else echo "$l_group_empty"; |
echo "</td></tr>"; |
} |
if ($config[general_lib_type] == 'ldap' || |
($config[general_lib_type] == 'sql' && $config[sql_use_user_info_table] == 'true')){ |
if ($config['general_lib_type'] == 'ldap' || |
($config['general_lib_type'] == 'sql' && $config['sql_use_user_info_table'] == 'true')){ |
echo <<<EOM |
<tr> |
<td class="etiquette" colspan=$colspan> |
206,7 → 212,13 |
if ($name == 'none') |
continue; |
$oper_name = $name . '_op'; |
$val = ($item_vals["$key"][0] != "") ? $item_vals["$key"][0] : $default_vals["$key"][0]; |
if(isset($item_vals["$key"][0]) && $item_vals["$key"][0] != ''){ |
$val = $item_vals["$key"][0]; |
} else if(isset($default_vals["$key"][0])) { |
$val = $default_vals["$key"][0]; |
} else { |
$val = ''; |
} |
/* |
Gestion d'un mode simple ou d'un mode avancé |
Définition du mode avancé: les attributs concernant la gestion des octets, de la bande passante |
219,13 → 231,13 |
case 'ChilliSpot-Bandwidth-Max-Up' : |
case 'ChilliSpot-Bandwidth-Max-Down' : |
case 'WISPr-Redirection-URL' : |
case 'Login-Time' : |
case 'Login-Time' : |
case 'Session-Timeout' : |
case 'Max-Daily-Session' : |
case 'Max-Monthly-Session' : |
$advanced=0; //<-- attribut non-affiché |
break; |
case 'Simultaneous-Use' : |
case 'Simultaneous-Use' : |
$advanced=1; |
$help_link="help/simultaneous_use_help.html"; |
$desc=$l_simultaneous_use; |
257,12 → 269,12 |
</td> |
EOM; |
switch ($key){ |
case 'Simultaneous-Use' : |
case 'Simultaneous-Use' : |
case 'Max-All-Session' : |
case 'Max-Daily-Session' : |
case 'Max-Weekly-Session' : |
case 'Max-Monthly-Session' : |
case 'Login-Time' : |
case 'Login-Time' : |
case 'Expiration' : |
echo "<input type=\"hidden\" name=$oper_name value=\":=\">"; |
break; |
301,9 → 313,9 |
break; |
} |
} |
/* |
/* |
Ajout du pré-remplissage de cellule |
du choix d'unité (pour les durées limites de session,journée et de mois) |
du choix d'unité (pour les durées limites de session,journée et de mois) |
et d'un calendrier pour la date d'expiration |
Sauf dans le cas de la visualisation |
*/ |
316,9 → 328,9 |
echo"<input type=text name=\"$name\" value=\"$val\" size=20>"; |
break; |
/* |
Choix de l'unité heures, minutes ou secondes |
pour les durées limites de session,journée et de mois |
*/ |
Choix de l'unité heures, minutes ou secondes |
pour les durées limites de session,journée et de mois |
*/ |
case 'Session-Timeout' : |
case 'Max-Daily-Session' : |
/*valeur d'origine de durée limite */ |
378,7 → 390,7 |
<option value=\"es\" >Español</option> |
<option value=\"it\" >Italiano</option> |
<option value=\"pt\" >Portugês</option> |
</select></td></tr>"; |
</select></td></tr>"; |
} |
echo "</table>"; |
if($create == 1) |
/web/acc/manager/htdocs/user_new2.php |
---|
3,6 → 3,18 |
//gestion de la langue |
if (is_file("../lib/langues.php")) |
include("../lib/langues.php"); |
require('../lib/operators.php'); |
if(!isset($create)) $create=0; |
if(!isset($show)) $show=0; |
if(!isset($login)) $login = ''; |
if(!isset($cn)) $cn = ''; |
if(!isset($mail)) $mail = ''; |
if(!isset($langue_imp)) $langue_imp = ''; |
if(!isset($selected)) $selected = array(); |
if(!isset($selected['='])) $selected['='] = ''; |
require('/etc/freeradius-web/config.php'); |
if($show == 2) |
{ |
12,7 → 24,7 |
require('../lib/attrshow.php'); |
require('../lib/defaults.php'); |
if ($config[general_lib_type] == 'sql' && $config[sql_use_operators] == 'true'){ |
if ($config['general_lib_type'] == 'sql' && $config['sql_use_operators'] == 'true'){ |
$colspan=2; |
$show_ops=1; |
}else{ |
22,7 → 34,7 |
?> |
<html><head><title>User creation</title> |
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $config[general_charset]?>"> |
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $config['general_charset']?>"> |
<link rel="stylesheet" href="/css/style.css"> |
<link rel="stylesheet" type="text/css" href="/css/epoch_styles.css" /> |
<script type="text/javascript" src="/js/epoch_classes.js"></script> |
30,7 → 42,7 |
<script language="javascript" type="text/javascript"> |
/*Insertion du calendrier */ |
var dp_cal; |
var dp_cal; |
window.onload = function () { |
dp_cal = new Epoch('epoch_popup','popup',document.getElementById('popup_container')); |
}; |
60,11 → 72,12 |
</td></tr> |
<tr bgcolor="black" valign=top><td colspan=2> |
<table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top> |
<tr><td> |
<tr><td> |
<?php |
function sec_imp($time) |
/*Formatage des secondes avant l'impression */ |
{ |
/*Formatage des secondes avant l'impression */ |
{ |
$result = ''; |
$jour = 0;$heure = 0;$minute = 0;$seconde = 0; |
$jour = floor($time/86400); |
$reste = $time%86400; |
77,7 → 90,7 |
$seconde = $reste%60; |
if ($seconde!=0) $result = $result.$seconde.' s '; |
return $result; |
} |
} |
if ($create == 1){ |
if (is_file("../lib/$config[general_lib_type]/user_info.php")) |
92,7 → 105,7 |
include("../lib/$config[general_lib_type]/create_user.php"); |
/* Petit traitement pré-impression pour la lisibilité */ |
/* Récupération des attributs du groupe le cas échéant */ |
if ($group!=''){ |
if (isset($group) && $group!=''){ |
$saved_login = $login; |
$login = $group; |
if (is_file("../lib/sql/group_info.php")) |
100,19 → 113,19 |
$login = $saved_login;} |
/* Si les valeurs de durée sont vide remplissage avec la valeur 'Illimitée'*/ |
/* et formatage des secondes sous le format Heure min ses*/ |
if ($sto_imp==''){ $sto_imp=$v_illimit;} |
if ($sto_imp==''){ $sto_imp='-';} |
else { $sto_imp=sec_imp($sto_imp);} |
if ($mas_imp==''){ $mas_imp=$v_illimit;} |
if ($mas_imp==''){ $mas_imp='-';} |
else { $mas_imp=sec_imp($mas_imp);} |
if ($mds_imp==''){ $mds_imp=$v_illimit;} |
if ($mds_imp==''){ $mds_imp='-';} |
else { $mds_imp=sec_imp($mds_imp);} |
if ($mms_imp==''){ $mms_imp=$v_illimit;} |
if ($mms_imp==''){ $mms_imp='-';} |
else { $mms_imp=sec_imp($mms_imp);} |
/*Formatage de la date afin d'être lisible dans toute les langues 'jj mm yyyy'*/ |
if ($Expiration!=''){ $Expiration=date("d - m - Y",strtotime($Expiration));} |
else { $Expiration=$v_without;} |
else { $Expiration='-';} |
if ($show != 3) |
{ |
{ |
//Appel du ticket d'impression , passage en paramètres des valeurs à afficher |
echo' <form name="impression" method="post" action="ticket_user.php" target=_blank> |
<input type="hidden" name="langue_imp" value="'.$langue_imp.'"> |
162,7 → 175,7 |
</td> |
</tr> |
EOM; |
if ($config[general_lib_type] == 'sql'){ |
if ($config['general_lib_type'] == 'sql'){ |
if (isset($member_groups)) |
$selected[$member_groups[0]] = 'selected'; |
echo <<<EOM |
182,8 → 195,8 |
else echo "$l_group_empty"; |
echo "</td></tr>"; |
} |
if ($config[general_lib_type] == 'ldap' || |
($config[general_lib_type] == 'sql' && $config[sql_use_user_info_table] == 'true')){ |
if ($config['general_lib_type'] == 'ldap' || |
($config['general_lib_type'] == 'sql' && $config['sql_use_user_info_table'] == 'true')){ |
echo <<<EOM |
<tr> |
<td class="etiquette" colspan=$colspan> |
206,11 → 219,17 |
if ($name == 'none') |
continue; |
$oper_name = $name . '_op'; |
$val = ($item_vals["$key"][0] != "") ? $item_vals["$key"][0] : $default_vals["$key"][0]; |
if(isset($item_vals["$key"][0]) && $item_vals["$key"][0] != '') { |
$val = $item_vals["$key"][0]; |
} else if(isset($default_vals["$key"][0])){ |
$val = $default_vals["$key"][0]; |
} else{ |
$val = ''; |
} |
switch ($key) |
{ |
// $advanced = 1 : champs de saisie amélioré (calendrier, convertisseur, etc.) |
case 'Simultaneous-Use' : |
// $advanced = 1 : champs de saisie amélioré (calendrier, convertisseur, etc.) |
case 'Simultaneous-Use' : |
$advanced=1; |
$help_link="help/simultaneous_use_help.html"; |
$desc=$l_simultaneous_use; |
220,7 → 239,7 |
$help_link="help/max_all_session_help.html"; |
$desc=$l_max_all_session; |
break; |
case 'Session-Timeout' : |
case 'Session-Timeout' : |
$advanced=1; |
$help_link="help/session_timeout_help.html"; |
$desc=$l_session_timeout; |
235,7 → 254,7 |
$help_link="help/session_timeout_help.html"; |
$desc=$l_monthly_timeout; |
break; |
case 'Login-Time' : |
case 'Login-Time' : |
$advanced=1; |
$help_link="help/login_time_help.html"; |
$desc=$l_login_time; |
292,12 → 311,12 |
</td> |
EOM; |
switch ($key){ |
case 'Simultaneous-Use' : |
case 'Simultaneous-Use' : |
case 'Max-All-Session' : |
case 'Max-Daily-Session' : |
case 'Max-Weekly-Session' : |
case 'Max-Monthly-Session' : |
case 'Login-Time' : |
case 'Login-Time' : |
case 'Expiration' : |
echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:="; |
break; |
336,8 → 355,8 |
break; |
} |
} |
/* |
Ajout du choix d'unité (pour les durées limites de session,journée et de mois) |
/* |
Ajout du choix d'unité (pour les durées limites de session,journée et de mois) |
et d'un calendrier pour la date d'expiration |
Sauf dans le cas de la visualisation |
*/ |
345,9 → 364,9 |
if ($create==0 ){ |
switch ($name){ |
/* |
Choix de l'unité jour, heures, minutes ou secondes |
pour les durées limites max, de session,de journée et de mois |
*/ |
Choix de l'unité jour, heures, minutes ou secondes |
pour les durées limites max, de session,de journée et de mois |
*/ |
case 'Session-Timeout' : |
case 'Max-Daily-Session' : |
/*valeur d'origine de durée limite */ |
405,7 → 424,7 |
<option value=\"es\" >Español</option> |
<option value=\"it\" >Italiano</option> |
<option value=\"pt\" >Portugês</option> |
</select></td></tr>"; |
</select></td></tr>"; |
} |
echo "</table><BR>"; |
if($create == 1) |
413,7 → 432,7 |
echo "<a href=\"ticket.pdf\">Ticket</a><br>"; |
echo "<center><a href=\"user_admin.php?login=$login\">$l_show_profile</a></center>"; |
} |
else |
else |
{ |
echo "<input type=submit class=button value=\"$l_create\" OnClick=\"return formControl('newuser');\">"; |
echo "<input type='hidden' name='nbtickets' value=''>"; |
/web/acc/manager/html/user_admin.html.php |
---|
10,7 → 10,7 |
<body> |
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0"> |
<tr><th>$l_users_managment</th></tr> |
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" |
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" |
height="2"></td></tr> |
</TABLE> |
<TABLE width="100%" border=0 cellspacing=0 cellpadding=1> |
19,14 → 19,14 |
<tr><td valign="middle" align="left"> |
<link rel="stylesheet" href="/css/style.css"> |
EOM; |
if ($logged_now) |
if (isset($logged_now) && $logged_now) |
print <<<EOM |
<script Language="JavaScript"> |
<!-- |
var start; |
var our_time; |
function startcounter() |
function startcounter() |
{ |
var start_date = new Date(); |
start = start_date.getTime(); |
38,21 → 38,21 |
{ |
var now_date = new Date(); |
var diff = now_date.getTime() - start + our_time; |
var hours = parseInt(diff / 3600000); |
if(isNaN(hours)) hours = 0; |
var minutes = parseInt((diff % 3600000) / 60000); |
if(isNaN(minutes)) minutes = 0; |
var seconds = parseInt(((diff % 3600000) % 60000) / 1000); |
if(isNaN(seconds)) seconds = 0; |
var timeValue = " " ; |
timeValue += ((hours < 10) ? "0" : "") + hours; |
timeValue += ((minutes < 10) ? ":0" : ":") + minutes; |
timeValue += ((seconds < 10) ? ":0" : ":") + seconds; |
document.online.status.value = timeValue; |
setTimeout("showcounter()", 1000); |
} |
86,7 → 86,7 |
<table border=1 bordercolordark=#ffffe0 bordercolorlight=#000000 width=100% cellpadding=2 cellspacing=0 bgcolor="#ffffe0" valign=top> |
EOM; |
if ($logged_now){ |
if (isset($logged_now) && $logged_now){ |
print <<<EOM |
<form name="online" onSubmit="return(false);"> |
<tr><td align=center bgcolor="#d0ddb0"> |
96,7 → 96,7 |
</td></tr> |
<tr><td align=center bgcolor="#d0ddb0"> |
<b>$l_connection_time</b> |
</td><td> |
</td><td> |
<input type="text" name="status" size=10 value="$lastlog_session_time"> |
</form> |
</td></tr> |
211,7 → 211,7 |
<tr><td align=center bgcolor="#d0ddb0"><b>$l_download ($l_average)</b></td><td> |
$avg_input</td></tr> |
<tr><td align=center bgcolor="#d0ddb0"><b>$l_upload ($l_average)</b></td><td> |
$avg_output</td></tr> |
$avg_output</td></tr> |
</table> |
</table> |
</table> |
410,7 → 410,7 |
print <<<EOM |
</tr></table> |
EOM; |
if ($logged_now) |
if (isset($logged_now) && $logged_now) |
print <<<EOM |
<script Language="JavaScript"> |
startcounter(); |
/web/acc/manager/lib/acctshow.php |
---|
0,0 → 1,20 |
<?php |
#Read sql attribute map |
unset($sql_attrs); |
if (isset($_SESSION['sql_attrs'])) |
$sql_attrs = $_SESSION["sql_attrs"]; |
if (!isset($sql_attrs)){ |
$ARR = file($config[general_sql_attrs_file]); |
foreach($ARR as $val){ |
$val=chop($val); |
if (preg_match('/^[[:space:]]*#/',$val) || preg_match('/^[[:space:]]*$/',$val)) |
continue; |
list($key,$desc,$show,$func)=preg_split("/\t+/",$val); |
$sql_attrs[strtolower($key)][desc] = "$desc"; |
$sql_attrs[strtolower($key)][show] = "$show"; |
$sql_attrs[strtolower($key)][func] = ($func == "") ? "nothing" : "$func"; |
} |
if ($config[general_use_session] == 'yes') |
session_register('sql_attrs'); |
} |
?> |
/web/acc/manager/lib/add_badusers.php |
---|
0,0 → 1,38 |
<?php |
if (is_file("../lib/sql/drivers/$config[sql_type]/functions.php")) |
include_once("../lib/sql/drivers/$config[sql_type]/functions.php"); |
else{ |
echo "<b>Could not include SQL library</b><br>\n"; |
exit(); |
} |
$date=date($config[sql_full_date_format]); |
$lockmsg_name = $attrmap['Dialup-Lock-Msg'] . '0'; |
$msg = $$lockmsg_name; |
$admin = '-'; |
if ($_SERVER["PHP_AUTH_USER"] != '') |
$admin = $_SERVER["PHP_AUTH_USER"]; |
if ($msg == '') |
echo "<b>Lock Message should not be empty</b><br>\n"; |
else{ |
$sql_servers = array(); |
if ($config[sql_extra_servers] != '') |
$sql_servers = explode(' ',$config[sql_extra_servers]); |
$sql_servers[] = $config[sql_server]; |
foreach ($sql_servers as $server){ |
$link = da_sql_host_connect($server,$config); |
if ($link){ |
$r = da_sql_query($link,$config, |
"INSERT INTO $config[sql_badusers_table] (username,incidentdate,admin,reason) |
VALUES ('$login','$date','$admin','$msg');"); |
if (!$r) |
echo "<b>SQL Error:" . da_sql_error($link,$config) . "</b><br>\n"; |
else |
echo "<b>User added to badusers table</b><br>\n"; |
da_sql_close($link,$config); |
} |
else |
echo "<b>SQL Error: Could not connect to SQL database: $server</b><br>\n"; |
} |
} |
?> |
/web/acc/manager/lib/attrshow.php |
---|
0,0 → 1,54 |
<?php |
//include_once('../lib/xlat.php'); |
#Read user_edit attribute map |
unset($show_attrs); |
if (isset($_SESSION['show_attrs'])) |
$show_attrs = $_SESSION['show_attrs']; |
if (!isset($show_attrs)){ |
$infile = $config['general_user_edit_attrs_file']; |
$ARR = file($infile); |
foreach($ARR as $val){ |
$val=chop($val); |
if (preg_match('/^[[:space:]]*#/',$val) || preg_match('/^[[:space:]]*$/',$val)) |
continue; |
list($key,$v)=preg_split("/\t+/",$val); |
$show_attrs["$key"]=($v != '') ? "$v" : "$key"; |
} |
if ($config['general_use_session'] == 'yes') |
session_register('show_attrs'); |
} |
unset($acct_attrs); |
if (isset($_SESSION['acct_attrs'])) |
$acct_attrs = $_SESSION['acct_attrs']; |
if (!isset($acct_attrs) && isset($config['general_accounting_attrs_file'])){ |
$infile = $config['general_accounting_attrs_file']; |
$ARR = file($infile); |
$acct_attrs = array(); |
$acct_attrs["ua"] = array(); |
$acct_attrs["ua"]['num'] = 0; |
$acct_attrs["uf"] = array(); |
$acct_attrs["uf"]['num'] = 0; |
$acct_attrs["fl"] = array(); |
$acct_attrs["fl"]['num'] = 0; |
foreach ($ARR as $val){ |
$val=chop($val); |
if (preg_match('/^[[:space:]]*#/',$val) || preg_match('/^[[:space:]]*$/',$val)) |
continue; |
list($num,$desc,$showua,$showuf,$showfl)=preg_split("/\t+/",$val); |
if ($showua == 'yes'){ |
$acct_attrs["ua"]["num"]++; |
$acct_attrs["ua"]["$num"]=$desc; |
} |
if ($showuf == 'yes'){ |
$acct_attrs["uf"]["num"]++; |
$acct_attrs["uf"]["$num"]=$desc; |
} |
if ($showfl == 'yes'){ |
$acct_attrs["fl"]["num"]++; |
$acct_attrs["fl"]["$num"]=$desc; |
} |
} |
if ($config['general_use_session'] == 'yes') |
session_register('acct_attrs'); |
} |
?> |
/web/acc/manager/lib/crypt/clear.php |
---|
0,0 → 1,6 |
<?php |
function da_encrypt($passwd) |
{ |
return $passwd; |
} |
?> |
/web/acc/manager/lib/crypt/md5.php |
---|
0,0 → 1,6 |
<?php |
function da_encrypt($passwd) |
{ |
return md5($passwd); |
} |
?> |
/web/acc/manager/lib/defaults.php |
---|
0,0 → 1,24 |
<?php |
unset($text_default_vals); |
unset($default_vals); |
if (isset($_SESSION['text_default_vals'])) |
$text_default_vals = $_SESSION['text_default_vals']; |
if (!isset($text_default_vals)){ |
$ARR=file("$config[general_default_file]"); |
foreach($ARR as $val) { |
$val=chop($val); |
if (preg_match('/^[[:space:]]*#/',$val) || preg_match('/^[[:space:]]*$/',$val)) |
continue; |
list($key,$v)=preg_split("/:[[:space:]]*/",$val,2); |
$text_default_vals["$key"][0]="$v"; |
$text_default_vals["$key"]['count']++; |
} |
if (!isset($text_default_vals)) |
$text_default_vals["NOT_EXIST"][0] = '0'; |
if ($config['general_use_session'] == 'yes') |
session_register('text_default_vals'); |
} |
$default_vals = $text_default_vals; |
if (is_file("../lib/$config[general_lib_type]/defaults.php")) |
include("../lib/$config[general_lib_type]/defaults.php"); |
?> |
/web/acc/manager/lib/functions.php |
---|
6,6 → 6,7 |
return "0 seconds"; |
$d = $time/86400; |
$d = floor($d); |
$str = ''; |
if ($d){ |
$str .= "$d days, "; |
$time = $time % 86400; |
24,8 → 25,9 |
} |
if ($time) |
$str .= "$time seconds, "; |
$str = ereg_replace(', $','',$str); |
$str = preg_replace('/, $/','',$str); |
return $str; |
} |
115,8 → 117,8 |
} |
function check_defaults($val,$op,$def) |
{ |
for($i=0;$i<$def[count];$i++){ |
if ($val == $def[$i] && ($op == '' || $op == $def[operator][$i])) |
for($i=0;$i<$def['count'];$i++){ |
if ($val == $def[$i] && ($op == '' || $op == $def['operator'][$i])) |
return 1; |
} |
/web/acc/manager/lib/lang/default/utf8.php |
---|
0,0 → 1,11 |
<?php |
function init_decoder() |
{ |
return 0; |
} |
function decode_string($line,$k) |
{ |
return $line; |
} |
?> |
/web/acc/manager/lib/lang/el/utf8.php |
---|
0,0 → 1,91 |
<?php |
function init_encoder() |
{ |
$k = array( |
"~@"=>"", "~A"=>"", "~B"=>"", "~C"=>"", "~D"=>"", "~E"=>" ", |
"~F"=>"", "~G"=>"", "~H"=>"", "~I"=>"", "~J"=>"", "~K"=>"", |
"~L"=>"", "~M"=>"", "~N"=>"", "~O"=>"", "~P"=>"", "~Q"=>"", |
"~R"=>"", "~S"=>"", "~T"=>"", "~U"=>"", "~V"=>"", "~W"=>"", |
"~^"=>"Â", "~_"=>"Â", "| "=>" ", "¡"=>"ʽ", "¢"=>"ʼ", "£"=>"£", |
"¤"=>"�", "¥"=>"�", "¦"=>"¦", "§"=>"§", "¨"=>"¨", "©"=>"©", |
"ª"=>"�", "«"=>"«", "¬"=>"¬", ""=>"Â", "®"=>"�", "¯"=>"â", |
"°"=>"°", "±"=>"±", "²"=>"²", "³"=>"³", "´"=>"Î", "µ"=>"Î ", |
"¶"=>"Î", "·"=>"·", "¸"=>"Î", "¹"=>"Î", "º"=>"Î", "»"=>"»", |
"¼"=>"Î", "½"=>"½", "¾"=>"Î", "¿"=>"Î", "À"=>"Î", "Á"=>"Î", |
"Â"=>"Î", "Ã"=>"Î", "Ä"=>"Î", "Å"=>"Î", "Æ"=>"Î", "Ç"=>"Î", |
"È"=>"Î", "É"=>"Î", "Ê"=>"Î", "Ë"=>"Î", "Ì"=>"Î", "Í"=>"Î", |
"Î"=>"Î", "Ï"=>"Î", "Ð"=>"Î ", "Ñ"=>"Ρ", "Ò"=>"�", "Ó"=>"Σ", |
"Ô"=>"Τ", "Õ"=>"Î¥", "Ö"=>"Φ", "×"=>"Χ", "Ø"=>"Ψ", "Ù"=>"Ω", |
"Ú"=>"Ϊ", "Û"=>"Ϋ", "Ü"=>"ά", "Ý"=>"Î", "Þ"=>"ή", "ß"=>"ί", |
"à"=>"ΰ", "á"=>"α", "â"=>"β", "ã"=>"γ", "ä"=>"δ", "å"=>"ε", |
"æ"=>"ζ", "ç"=>"η", "è"=>"θ", "é"=>"ι", "ê"=>"κ", "ë"=>"λ", |
"ì"=>"μ", "í"=>"ν", "î"=>"ξ", "ï"=>"ο", "ð"=>"Ï", "ñ"=>"Ï", |
"ò"=>"Ï", "ó"=>"Ï", "ô"=>"Ï", "õ"=>"Ï ", "ö"=>"Ï", "÷"=>"Ï", |
"ø"=>"Ï", "ù"=>"Ï", "ú"=>"Ï", "û"=>"Ï", "ü"=>"Ï", "ý"=>"Ï", |
"þ"=>"Ï", "~X"=>"Â", "~Y"=>"Â", "~Z"=>"Â", "~["=>"Â", "~]"=>"Â" |
); |
return $k; |
} |
function init_decoder() |
{ |
$k = array( |
""=>"~@", ""=>"~A", ""=>"~B", ""=>"~C", ""=>"~D", " "=>"~E", |
""=>"~F", ""=>"~G", ""=>"~H", ""=>"~I", ""=>"~J", ""=>"~K", |
""=>"~L", ""=>"~M", ""=>"~N", ""=>"~O", ""=>"~P", ""=>"~Q", |
""=>"~R", ""=>"~S", ""=>"~T", ""=>"~U", ""=>"~V", ""=>"~W", |
"Â"=>"~^", "Â"=>"~_", " "=>"| ", "ʽ"=>"¡", "ʼ"=>"¢", "£"=>"£", |
"�"=>"¤", "�"=>"¥", "¦"=>"¦", "§"=>"§", "¨"=>"¨", "©"=>"©", |
"�"=>"ª", "«"=>"«", "¬"=>"¬", "Â"=>"", "�"=>"®", "â"=>"¯", |
"°"=>"°", "±"=>"±", "²"=>"²", "³"=>"³", "Î"=>"´", "Î "=>"µ", |
"Î"=>"¶", "·"=>"·", "Î"=>"¸", "Î"=>"¹", "Î"=>"º", "»"=>"»", |
"Î"=>"¼", "½"=>"½", "Î"=>"¾", "Î"=>"¿", "Î"=>"À", "Î"=>"Á", |
"Î"=>"Â", "Î"=>"Ã", "Î"=>"Ä", "Î"=>"Å", "Î"=>"Æ", "Î"=>"Ç", |
"Î"=>"È", "Î"=>"É", "Î"=>"Ê", "Î"=>"Ë", "Î"=>"Ì", "Î"=>"Í", |
"Î"=>"Î", "Î"=>"Ï", "Î "=>"Ð", "Ρ"=>"Ñ", "�"=>"Ò", "Σ"=>"Ó", |
"Τ"=>"Ô", "Î¥"=>"Õ", "Φ"=>"Ö", "Χ"=>"×", "Ψ"=>"Ø", "Ω"=>"Ù", |
"Ϊ"=>"Ú", "Ϋ"=>"Û", "ά"=>"Ü", "Î"=>"Ý", "ή"=>"Þ", "ί"=>"ß", |
"ΰ"=>"à", "α"=>"á", "β"=>"â", "γ"=>"ã", "δ"=>"ä", "ε"=>"å", |
"ζ"=>"æ", "η"=>"ç", "θ"=>"è", "ι"=>"é", "κ"=>"ê", "λ"=>"ë", |
"μ"=>"ì", "ν"=>"í", "ξ"=>"î", "ο"=>"ï", "Ï"=>"ð", "Ï"=>"ñ", |
"Ï"=>"ò", "Ï"=>"ó", "Ï"=>"ô", "Ï "=>"õ", "Ï"=>"ö", "Ï"=>"÷", |
"Ï"=>"ø", "Ï"=>"ù", "Ï"=>"ú", "Ï"=>"û", "Ï"=>"ü", "Ï"=>"ý", |
"Ï"=>"þ", "Â"=>"~X", "Â"=>"~Y", "Â"=>"~Z", "Â"=>"~[", "Â"=>"~]" |
); |
return $k; |
} |
function encode_string($line,$k) |
{ |
for($i=0;$i<strlen($line);$i++){ |
$c = $line{$i}; |
$val = $k["$c"]; |
$c = ($val != "") ? "$val" : "$c"; |
$new_line .= $c; |
} |
return $new_line; |
} |
function decode_string($line,$k) |
{ |
$line = preg_replace("/&/","&&",$line); |
$line = preg_replace("/([,+0-9.\/() -])/", "%\\1", $line); |
$mline = chunk_split($line, 2, " "); |
$chars = explode(" ", $mline); |
foreach ($chars as $c){ |
$val = $k["$c"]; |
$c = ($val != "") ? "$val" : "$c"; |
$new_line .= $c; |
} |
$new_line = preg_replace("/%%/", " ", $new_line); |
$new_line = preg_replace("/%([,+0-9.\/() -])/", "\\1", $new_line); |
$new_line = preg_replace("/%/", " ",$new_line); |
$new_line = preg_replace("/&&/","&",$new_line); |
return $new_line; |
} |
?> |
/web/acc/manager/lib/operators.php |
---|
0,0 → 1,42 |
<?php |
$op_eq = '='; |
$op_set = ':='; |
$op_add = '+='; |
$op_eq2 = '=='; |
$op_ne = '!='; |
$op_gt = '>'; |
$op_ge = '>='; |
$op_lt = '<'; |
$op_le = '<='; |
$op_regeq = '=~'; |
$op_regne = '!~'; |
$op_exst = '=*'; |
$op_nexst = '!*'; |
// Check the operator if it is allowed for this type of |
// attribute (check or reply). |
// Arguments: |
// $op: The operator |
// $type: 1(check),2(reply) |
// Return value:0 for OK, -1 for error |
function check_operator($op,$type) |
{ |
switch($op){ |
case '=': |
case ':=': |
case '+=': |
return 0; |
case '==': |
case '!=': |
case '>': |
case '>=': |
case '<': |
case '<=': |
case '=~': |
case '!~': |
case '=*': |
case '!*': |
return ($type == 1) ? 0 : -1; |
} |
} |
?> |
/web/acc/manager/lib/sql/attrmap.php |
---|
0,0 → 1,37 |
<?php |
#Read sql attribute map |
unset($attrmap); |
unset($rev_attrmap); |
unset($attr_type); |
if (isset($_SESSION['attrmap'])){ |
#If attrmap is set then the rest will also be set |
$attrmap = $_SESSION['attrmap']; |
$rev_attrmap =$_SESSION['rev_attrmap']; |
$attr_type = $_SESSION['attr_type']; |
} |
else{ |
$ARR = file("$config[general_sql_attrmap]"); |
foreach($ARR as $val){ |
$val=chop($val); |
if (preg_match('/^[[:space:]]*#/',$val) || preg_match('/^[[:space:]]*$/',$val)) |
continue; |
list($type,$key,$v)=preg_split('/[[:space:]]+/',$val); |
$attrmap["$key"]=$v; |
$rev_attrmap["$v"] = $key; |
$attr_type["$key"]=$type; |
} |
if (isset($show_attrs)){ |
foreach($show_attrs as $key => $desc){ |
if (!isset($attrmap["$key"]) || $attrmap["$key"] == ''){ |
$attrmap["$key"] = $key; |
$attr_type["key"] = 'replyItem'; |
$rev_attrmap["$key"] = $key; |
} |
} |
} |
if ($config['general_use_session'] == 'yes'){ |
session_register('attrmap'); |
session_register('rev_attrmap'); |
session_register('attr_type'); |
} |
} |
/web/acc/manager/lib/sql/change_attrs.php |
---|
6,12 → 6,12 |
echo "<b>Could not include SQL library</b><br>\n"; |
exit(); |
} |
if ($config[sql_use_operators] == 'true'){ |
if ($config['sql_use_operators'] == 'true'){ |
$use_ops=1; |
$text1 = 'AND op ='; |
$text2 = ',op'; |
} |
$link = @da_sql_pconnect($config); |
$link = da_sql_pconnect($config); |
if ($link){ |
foreach($show_attrs as $key => $desc){ |
if ($attrmap["$key"] == 'none') |
26,7 → 26,7 |
$name = $attrmap["$key"] . $i; |
while(isset($$name)){ |
$val=$$name; |
$val = da_sql_escape_string($val); |
$val = da_sql_escape_string($link, $val); |
$op_name = $name . '_op'; |
$i++; |
$j++; |
33,18 → 33,18 |
$name = $attrmap["$key"] . $i; |
$sql_attr=$attrmap["$key"]; |
$query_key = ($user_type == 'group') ? 'groupname' : 'username'; |
if ($attr_type["$key"] == 'checkItem'){ |
$table = ($user_type == 'group') ? $config[sql_groupcheck_table] : $config[sql_check_table]; |
if (isset($attr_type["$key"]) && $attr_type["$key"] == 'checkItem'){ |
$table = ($user_type == 'group') ? $config['sql_groupcheck_table'] : $config['sql_check_table']; |
$type = 1; |
} |
else if ($attr_type["$key"] == 'replyItem'){ |
$table = ($user_type == 'group') ? $config[sql_groupreply_table] : $config[sql_reply_table]; |
else if (isset($attr_type["$key"]) && $attr_type["$key"] == 'replyItem'){ |
$table = ($user_type == 'group') ? $config['sql_groupreply_table'] : $config['sql_reply_table']; |
$type = 2; |
} |
if ($use_ops){ |
$op_val = $$op_name; |
if ($op_val != ''){ |
$op_val = da_sql_escape_string($op_val); |
$op_val = da_sql_escape_string($link, $op_val); |
if (check_operator($op_val,$type) == -1){ |
echo "<b>Invalid operator ($op_val) for attribute $key</b><br>\n"; |
continue; |
52,25 → 52,26 |
$op_val2 = ",'$op_val'"; |
} |
} |
$sql_attr = da_sql_escape_string($sql_attr); |
$val = da_sql_escape_string($val); |
$sql_attr = da_sql_escape_string($link, $sql_attr); |
$val = da_sql_escape_string($link, $val); |
// if we have operators, the operator has changed and the corresponding value exists then update |
if ($use_ops && isset($item_vals["$key"][operator][$j]) && |
$op_val != $item_vals["$key"][operator][$j] ){ |
$res = @da_sql_query($link,$config, |
if ($use_ops && isset($item_vals["$key"]['operator'][$j]) && |
$op_val != $item_vals["$key"]['operator'][$j] ){ |
$res = da_sql_query($link,$config, |
"UPDATE $table SET op = '$op_val' WHERE $query_key = '$login' |
AND attribute = '$sql_attr' AND value = '$val';"); |
if (!$res || !@da_sql_affected_rows($link,$res,$config)) |
if (!$res || !da_sql_affected_rows($link,$res,$config)) |
echo "<b>Operator change failed for attribute $key: " . da_sql_error($link,$config) . "</b><br>\n"; |
} |
$chkdef = (isset($default_vals["$key"])) ? check_defaults($val,$op_val,$default_vals["$key"]) : 0; |
// if value is the same as that in the sql database do nothing |
if ($val == $item_vals["$key"][$j]) |
if (isset($item_vals["$key"]) && $val == $item_vals["$key"][$j]) |
continue; |
// if value is null or equals the default value and corresponding value exists then delete |
else if ((check_defaults($val,$op_val,$default_vals["$key"]) || $val == '' || ($sql_attr == "Filter-Id" && $val == "None")) && isset($item_vals["$key"][$j])){ |
$res = @da_sql_query($link,$config, |
else if (($chkdef || $val == '' || ($sql_attr == "Filter-Id" && $val == "None")) && isset($item_vals["$key"][$j])){ |
$res = da_sql_query($link,$config, |
"DELETE FROM $table WHERE $query_key = '$login' AND attribute = '$sql_attr';"); |
if (!$res || !@da_sql_affected_rows($link,$res,$config)) |
if (!$res || !da_sql_affected_rows($link,$res,$config)) |
echo "<b>Delete failed for attribute $key: " . da_sql_error($link,$config) . "</b><br>\n"; |
} |
// if value is null or equals the default value then don't add it |
80,16 → 81,16 |
else{ |
if (isset($item_vals["$key"][$j])){ |
$old_val = $item_vals["$key"][$j]; |
$old_val = da_sql_escape_string($old_val); |
$res = @da_sql_query($link,$config, |
$old_val = da_sql_escape_string($link, $old_val); |
$res = da_sql_query($link,$config, |
"UPDATE $table SET value = '$val' WHERE $query_key = '$login' AND |
attribute = '$sql_attr' AND value = '$old_val';"); |
} |
else |
$res = @da_sql_query($link,$config, |
$res = da_sql_query($link,$config, |
"INSERT INTO $table ($query_key,attribute,value $text2) |
VALUES ('$login','$sql_attr','$val' $op_val2);"); |
if (!$res || !@da_sql_affected_rows($link,$res,$config)) |
if (!$res || !da_sql_affected_rows($link,$res,$config)) |
echo "<b>Change failed for attribute $key: " . da_sql_error($link,$config) . "</b><br>\n"; |
} |
} |
/web/acc/manager/lib/sql/change_info.php |
---|
0,0 → 1,57 |
<?php |
if (is_file("../lib/sql/drivers/$config[sql_type]/functions.php")) |
include_once("../lib/sql/drivers/$config[sql_type]/functions.php"); |
else{ |
echo "<b>Could not include SQL library</b><br>\n"; |
exit(); |
} |
$link = da_sql_pconnect($config); |
$fail = 0; |
if ($link){ |
if ($config['sql_use_user_info_table'] == 'true'){ |
$res = da_sql_query($link,$config, |
"SELECT username FROM $config[sql_user_info_table] WHERE |
username = '$login';"); |
if ($res){ |
$Fcn = (isset($Fcn)) ? da_sql_escape_string($link, $Fcn) : ''; |
$Fmail = (isset($Fmail)) ? da_sql_escape_string($link, $Fmail) : ''; |
$Fou = (isset($Fou)) ? da_sql_escape_string($link, $Fou) : ''; |
$Fhomephone = (isset($Fhomephone)) ? da_sql_escape_string($link, $Fhomephone) : ''; |
$Ftelephonenumber = (isset($Ftelephonenumber)) ? da_sql_escape_string($link, $Ftelephonenumber) : ''; |
$Fmobile = (isset($Fmobile)) ? da_sql_escape_string($link, $Fmobile) : ''; |
if (!da_sql_num_rows($res,$config)){ |
$res = da_sql_query($link,$config, |
"INSERT INTO $config[sql_user_info_table] |
(username,name,mail,department,homephone,workphone,mobile) VALUES |
('$login','$Fcn','$Fmail','$Fou','$Ftelephonenumber','$Fhomephone','$Fmobile');"); |
if (!$res || !da_sql_affected_rows($link,$res,$config)){ |
echo "<b>Could not add user information in user info table: " . da_sql_error($link,$config) . "</b><br>\n"; |
$fail = 1; |
} |
} |
else{ |
$res = da_sql_query($link,$config, |
"UPDATE $config[sql_user_info_table] SET name = '$Fcn',Mail = '$Fmail', |
department = '$Fou', homephone = '$Fhomephone', workphone = '$Ftelephonenumber', |
mobile = '$Fmobile' WHERE username = '$login';"); |
if (!$res || !da_sql_affected_rows($link,$res,$config)){ |
echo "<b>Could not update user information in user info table: " . da_sql_error($link,$config) . "</b><br>\n"; |
$fail = 1; |
} |
} |
} |
else{ |
echo "<b>Could not find user in user info table: " . da_sql_error($link,$config) . "</b><br>\n"; |
$fail = 1; |
} |
if ($fail == 0) |
echo "<b>User information updated successfully</b><br>\n"; |
} |
else |
echo "<b>Cannot use the user info table. Check the sql_use_user_info_table directive in admin.conf</b><br>\n"; |
} |
else |
echo "<b>Could not connect to SQL database</b><br>\n"; |
?> |
/web/acc/manager/lib/sql/change_passwd.php |
---|
0,0 → 1,52 |
<?php |
if (is_file("../lib/sql/drivers/$config[sql_type]/functions.php")) |
include_once("../lib/sql/drivers/$config[sql_type]/functions.php"); |
else{ |
echo "<b>Could not include SQL library</b><br>\n"; |
exit(); |
} |
if ($config[sql_use_operators] == 'true'){ |
$text1 = ',op'; |
$text2 = ",':='"; |
$text3 = ", op = ':='"; |
} |
else{ |
$text1 = ''; |
$text2 = ''; |
$text3 = ''; |
} |
$link = da_sql_pconnect($config); |
if ($link){ |
if (is_file("../lib/crypt/$config[general_encryption_method].php")){ |
include("../lib/crypt/$config[general_encryption_method].php"); |
$passwd = da_encrypt($passwd); |
$passwd = da_sql_escape_string($passwd); |
$res = da_sql_query($link,$config, |
"SELECT value FROM $config[sql_check_table] WHERE username = '$login' |
AND attribute = '$config[sql_password_attribute]';"); |
if ($res){ |
$row = da_sql_fetch_array($res,$config); |
if ($row){ |
$res = da_sql_query($link,$config, |
"UPDATE $config[sql_check_table] SET value = '$passwd' $text3 WHERE |
attribute = '$config[sql_password_attribute]' AND username = '$login';"); |
if (!$res || !da_sql_affected_rows($link,$res,$config)) |
echo "<b>Error while changing password: " . da_sql_error($link,$config) . "</b><br>\n"; |
} |
else{ |
$res = da_sql_query($link,$config, |
"INSERT INTO $config[sql_check_table] (attribute,value,username $text1) |
VALUES ('$config[sql_password_attribute]','$passwd','$login' $text2);"); |
if (!$res || !da_sql_affected_rows($link,$res,$config)) |
echo "<b>Error while changing password: " . da_sql_error($link,$config) . "</b><br>\n"; |
} |
} |
else |
echo "<b>Error while executing query: " . da_sql_error($link,$config) . "</b><br>\n"; |
} |
else |
echo "<b>Could not open encryption library file</b><br>\n"; |
} |
else |
echo "<b>Could not connect to SQL database</b><br>\n"; |
?> |
/web/acc/manager/lib/sql/create_group.php |
---|
6,23 → 6,23 |
echo "<b>Could not include SQL library</b><br>\n"; |
exit(); |
} |
if ($config[sql_use_operators] == 'true'){ |
include("../lib/operators.php"); |
if ($config['sql_use_operators'] == 'true'){ |
include_once("../lib/operators.php"); |
$text = ',op'; |
$passwd_op = ",':='"; |
} |
$da_abort=0; |
$op_val2 = ''; |
$link = @da_sql_pconnect($config); |
$link = da_sql_pconnect($config); |
if ($link){ |
$Members = preg_split("/[\n\s]+/",$members,-1,PREG_SPLIT_NO_EMPTY); |
if (!empty($Members)){ |
foreach ($Members as $member){ |
$member = da_sql_escape_string($member); |
$res = @da_sql_query($link,$config, |
$member = da_sql_escape_string($link, $member); |
$res = da_sql_query($link,$config, |
"INSERT INTO $config[sql_usergroup_table] (username,groupname) |
VALUES ('$member','$login');"); |
if (!$res || !@da_sql_affected_rows($link,$res,$config)){ |
if (!$res || !da_sql_affected_rows($link,$res,$config)){ |
echo "<b>Unable to add user $member in group $login: " . da_sql_error($link,$config) . "</b><br>\n"; |
$da_abort=1; |
} |
30,10 → 30,10 |
} |
else |
{ |
$res = @da_sql_query($link,$config, |
$res = da_sql_query($link,$config, |
"INSERT INTO $config[sql_usergroup_table] (username,groupname) |
VALUES ('$login','$login');"); |
if (!$res || !@da_sql_affected_rows($link,$res,$config)) |
if (!$res || !da_sql_affected_rows($link,$res,$config)) |
{ |
echo "<b>Unable to add user $member in group $login: " . da_sql_error($link,$config) . "</b><br>\n"; |
$da_abort=1; |
55,20 → 55,20 |
$attr_type["$key"] = 'replyItem'; |
$rev_attrmap["$key"] = $key; |
} |
if ($attr_type["$key"] == 'checkItem'){ |
if (isset($attr_type["$key"]) && $attr_type["$key"] == 'checkItem'){ |
$table = "$config[sql_groupcheck_table]"; |
$type = 1; |
} |
else if ($attr_type["$key"] == 'replyItem'){ |
else if (isset($attr_type["$key"]) && $attr_type["$key"] == 'replyItem'){ |
$table = "$config[sql_groupreply_table]"; |
$type = 2; |
} |
$val = $$attrmap["$key"]; |
$val = da_sql_escape_string($val); |
$val = da_sql_escape_string($link, $val); |
$op_name = $attrmap["$key"] . '_op'; |
$op_val = $$op_name; |
if ($op_val != ''){ |
$op_val = da_sql_escape_string($op_val); |
$op_val = da_sql_escape_string($link, $op_val); |
if (check_operator($op_val,$type) == -1){ |
echo "<b>Invalid operator ($op_val) for attribute $key</b><br>\n"; |
coninue; |
75,12 → 75,13 |
} |
$op_val2 = ",'$op_val'"; |
} |
if ($val == '' || check_defaults($val,$op_val,$default_vals["$key"])) |
$chkdef = (isset($default_vals["$key"])) ? check_defaults($val,$op_val,$default_vals["$key"]) : 0; |
if ($val == '' || $chkdef) |
continue; |
$res = @da_sql_query($link,$config, |
$res = da_sql_query($link,$config, |
"INSERT INTO $table (attribute,value,groupname $text) |
VALUES ('$attrmap[$key]','$val','$login' $op_val2);"); |
if (!$res || !@da_sql_affected_rows($link,$res,$config)) |
if (!$res || !da_sql_affected_rows($link,$res,$config)) |
echo "<b>Query failed for attribute $key: " . da_sql_error($link,$config) . "</b><br>\n"; |
} |
echo "<b>Le groupe $login a été correctement créé</b><br>\n"; |
/web/acc/manager/lib/sql/create_user.php |
---|
1,4 → 1,4 |
<?php |
<?php |
if (is_file("../lib/sql/drivers/$config[sql_type]/functions.php")) |
include_once("../lib/sql/drivers/$config[sql_type]/functions.php"); |
else{ |
6,7 → 6,7 |
exit(); |
} |
include_once('../lib/functions.php'); |
if ($config[sql_use_operators] == 'true'){ |
if ($config['sql_use_operators'] == 'true'){ |
include_once("../lib/operators.php"); |
$text = ',op'; |
$passwd_op = ",':='"; |
13,7 → 13,7 |
} |
$da_abort=0; |
$op_val2 = ''; |
$link = @da_sql_pconnect($config); |
$link = da_sql_pconnect($config); |
if ($link){ |
if (is_file("../lib/crypt/$config[general_encryption_method].php")){ |
include_once("../lib/crypt/$config[general_encryption_method].php"); |
21,31 → 21,31 |
$passwd_imp = $passwd; |
/*Fin Ajout*/ |
$passwd = da_encrypt($passwd); |
$passwd = da_sql_escape_string($passwd); |
$res = @da_sql_query($link,$config, |
$passwd = da_sql_escape_string($link, $passwd); |
$res = da_sql_query($link,$config, |
"INSERT INTO $config[sql_check_table] (attribute,value,username $text) |
VALUES ('$config[sql_password_attribute]','$passwd','$login' $passwd_op);"); |
if (!$res || !@da_sql_affected_rows($link,$res,$config)){ |
if (!$res || !da_sql_affected_rows($link,$res,$config)){ |
echo "<b>Unable to add user $login: " . da_sql_error($link,$config) . "</b><br>\n"; |
$da_abort=1; |
} |
if ($config[sql_use_user_info_table] == 'true' && !$da_abort){ |
$res = @da_sql_query($link,$config, |
if ($config['sql_use_user_info_table'] == 'true' && !$da_abort){ |
$res = da_sql_query($link,$config, |
"SELECT username FROM $config[sql_user_info_table] WHERE |
username = '$login';"); |
if ($res){ |
if (!@da_sql_num_rows($res,$config)){ |
$Fcn = da_sql_escape_string($Fcn); |
$Fmail = da_sql_escape_string($Fmail); |
$Fou = da_sql_escape_string($Fou); |
$Fhomephone = da_sql_escape_string($Fhomephone); |
$Fworkphone = da_sql_escape_string($Fworkphone); |
$Fmobile = da_sql_escape_string($Fmobile); |
$res = @da_sql_query($link,$config, |
if (!da_sql_num_rows($res,$config)){ |
$Fcn = (isset($Fcn)) ? da_sql_escape_string($link, $Fcn) : ''; |
$Fmail = (isset($Fmail)) ? da_sql_escape_string($link, $Fmail) : ''; |
$Fou = (isset($Fou)) ? da_sql_escape_string($link, $Fou) : ''; |
$Fhomephone = (isset($Fhomephone)) ? da_sql_escape_string($link, $Fhomephone) : ''; |
$Ftelephonenumber = (isset($Ftelephonenumber)) ? da_sql_escape_string($link, $Ftelephonenumber) : ''; |
$Fmobile = (isset($Fmobile)) ? da_sql_escape_string($link, $Fmobile) : ''; |
$res = da_sql_query($link,$config, |
"INSERT INTO $config[sql_user_info_table] |
(username,name,mail,department,homephone,workphone,mobile) VALUES |
('$login','$Fcn','$Fmail','$Fou','$Fhomephone','$Ftelephonenumber','$Fmobile');"); |
if (!$res || !@da_sql_affected_rows($link,$res,$config)) |
if (!$res || !da_sql_affected_rows($link,$res,$config)) |
echo "<b>Could not add user information in user info table: " . da_sql_error($link,$config) . "</b><br>\n"; |
} |
else |
54,17 → 54,17 |
else |
echo "<b>Could not add user information in user info table: " . da_sql_error($link,$config) . "</b><br>\n"; |
} |
if ($Fgroup != ''){ |
$Fgroup = da_sql_escape_string($Fgroup); |
$res = @da_sql_query($link,$config, |
if (isset($Fgroup) && $Fgroup != ''){ |
$Fgroup = da_sql_escape_string($link, $Fgroup); |
$res = da_sql_query($link,$config, |
"SELECT username FROM $config[sql_usergroup_table] |
WHERE username = '$login' AND groupname = '$Fgroup';"); |
if ($res){ |
if (!@da_sql_num_rows($res,$config)){ |
$res = @da_sql_query($link,$config, |
if (!da_sql_num_rows($res,$config)){ |
$res = da_sql_query($link,$config, |
"INSERT INTO $config[sql_usergroup_table] |
(username,groupname) VALUES ('$login','$Fgroup');"); |
if (!$res || !@da_sql_affected_rows($link,$res,$config)) |
if (!$res || !da_sql_affected_rows($link,$res,$config)) |
echo "<b>Could not add user to group $Fgroup. SQL Error</b><br>\n"; |
} |
else |
74,7 → 74,7 |
echo "<b>Could not add user to group $Fgroup: " . da_sql_error($link,$config) . "</b><br>\n"; |
} |
if (!$da_abort){ |
if ($Fgroup != '') |
if (isset($Fgroup) && $Fgroup != '') |
require('../lib/defaults.php'); |
foreach($show_attrs as $key => $attr){ |
if ($attrmap["$key"] == 'none') |
86,15 → 86,15 |
$attr_type["$key"] = 'replyItem'; |
$rev_attrmap["$key"] = $key; |
} |
if ($attr_type["$key"] == 'checkItem'){ |
if (isset($attr_type["$key"]) && $attr_type["$key"] == 'checkItem'){ |
$table = "$config[sql_check_table]"; |
$type = 1; |
} |
else if ($attr_type["$key"] == 'replyItem'){ |
else if (isset($attr_type["$key"]) && $attr_type["$key"] == 'replyItem'){ |
$table = "$config[sql_reply_table]"; |
$type = 2; |
} |
$val = $$attrmap["$key"]; |
$val = (isset($$attrmap["$key"])) ? $$attrmap["$key"] : ''; |
/*Ajout en vue de l'impression des données (thank's to Geoffroy MUSITELLI)*/ |
if($key == "Session-Timeout") $sto_imp = $val; |
if($key == "Max-All-Session") $mas_imp = $val; |
101,11 → 101,11 |
if($key == "Max-Daily-Session") $mds_imp = $val; |
if($key == "Max-Monthly-Session") $mms_imp = $val; |
/*Fin Ajout*/ |
$val = da_sql_escape_string($val); |
$val = da_sql_escape_string($link, $val); |
$op_name = $attrmap["$key"] . '_op'; |
$op_val = $$op_name; |
$op_val = (isset($$op_name)) ? $$op_name : ''; |
if ($op_val != ''){ |
$op_val = da_sql_escape_string($op_val); |
$op_val = da_sql_escape_string($link, $op_val); |
if (check_operator($op_val,$type) == -1){ |
echo "<b>Invalid operator ($op_val) for attribute $key</b><br>\n"; |
continue; |
112,12 → 112,13 |
} |
$op_val2 = ",'$op_val'"; |
} |
if ($val == '' || check_defaults($val,$op_val,$default_vals["$key"])) |
$chkdef = (isset($default_vals["$key"])) ? check_defaults($val,$op_val,$default_vals["$key"]) : 0; |
if ($val == '' || $chkdef) |
continue; |
$res = @da_sql_query($link,$config, |
"INSERT INTO $table (attribute,value,username $text) |
VALUES ('$attrmap[$key]','$val','$login' $op_val2);"); |
if (!$res || !@da_sql_affected_rows($link,$res,$config)) |
$sqlquery = "INSERT INTO $table (attribute,value,username $text) |
VALUES ('$attrmap[$key]','$val','$login' $op_val2);"; |
$res = da_sql_query($link,$config,$sqlquery); |
if (!$res || !da_sql_affected_rows($link,$res,$config)) |
echo "<b>Query failed for attribute $key: " . da_sql_error($link,$config) . "</b><br>\n"; |
} |
} |
/web/acc/manager/lib/sql/defaults.php |
---|
0,0 → 1,139 |
<?php |
require('../lib/sql/attrmap.php'); |
if ((isset($login) && $login != '') && (isset($user_type) && $user_type !== 'group')){ |
if (is_file("../lib/sql/drivers/$config[sql_type]/functions.php")) |
include_once("../lib/sql/drivers/$config[sql_type]/functions.php"); |
else{ |
echo "<b>Could not include SQL library</b><br>\n"; |
exit(); |
} |
if ($config['sql_use_operators'] == 'true'){ |
$op = ',op'; |
$use_op = 1; |
}else{ |
$op = ""; |
$use_op = 0; |
} |
$overwrite_defaults = 1; |
$stop = 0; |
$times = 0; |
do{ |
unset($item_vals); |
unset($member_groups); |
unset($tmp); |
$times++; |
$link = da_sql_pconnect($config); |
if ($link){ |
$res = da_sql_query($link,$config, |
"SELECT groupname FROM $config[sql_usergroup_table] WHERE username = '$login';"); |
if ($res){ |
while(($row = da_sql_fetch_array($res,$config))){ |
$group = $row['groupname']; |
$member_groups[$group] = $group; |
} |
if (isset($member_groups)) |
ksort($member_groups); |
} |
if (isset($member_groups)){ |
$in = '('; |
foreach ($member_groups as $group) |
$in .= "'$group',"; |
$in = substr($in,0,-1); |
$in .= ')'; |
$res = da_sql_query($link,$config, |
"SELECT attribute,value $op FROM $config[sql_groupcheck_table] |
WHERE groupname IN $in;"); |
if ($res){ |
while(($row = da_sql_fetch_array($res,$config))){ |
$attr = $row['attribute']; |
$val = $row['value']; |
if ($use_op){ |
$oper = $row['op']; |
$tmp["$attr"]['operator'][]="$oper"; |
} |
$tmp["$attr"][]="$val"; |
$tmp["$attr"]['count']++; |
} |
$res = da_sql_query($link,$config, |
"SELECT attribute,value $op FROM $config[sql_groupreply_table] |
WHERE groupname IN $in;"); |
if ($res){ |
while(($row = da_sql_fetch_array($res,$config))){ |
$attr = $row['attribute']; |
$val = $row['value']; |
if ($use_op){ |
$oper = $row['op']; |
$tmp["$attr"]['operator'][]="$oper"; |
} |
$tmp["$attr"][] = "$val"; |
$tmp["$attr"]['count']++; |
} |
} |
else |
echo "<b>Database query failed partially: " . da_sql_error($link,$config) . "</b><br>\n"; |
} |
else |
echo "<b>Database query failed: " . da_sql_error($link,$config) . "</b><br>\n"; |
if (isset($tmp)){ |
foreach(array_keys($tmp) as $val){ |
if ($val == '') |
continue; |
$key = $rev_attrmap["$val"]; |
if ($key == ''){ |
$key = $val; |
$attrmap["$key"] = $val; |
$attr_type["$key"] = 'replyItem'; |
$rev_attrmap["$val"] = $key; |
} |
if (!isset($default_vals["$key"]) || $overwrite_defaults){ |
if ($use_op) |
$default_vals["$key"]['operator'] = $tmp["$val"]['operator']; |
if ($tmp[$val][0] != '') |
$default_vals["$key"] = $tmp["$val"]; |
} |
} |
} |
} |
if ($times == 1){ |
if (!isset($config['sql_default_user_profile']) || $config['sql_default_user_profile'] == '') |
$stop = 1; |
else{ |
$saved_login = $login; |
$saved_member_groups = $member_groups; |
$login = $config['sql_default_user_profile']; |
$overwrite_defaults = 0; |
} |
} |
if ($times == 2){ |
$login = $saved_login; |
$member_groups = $saved_member_groups; |
$stop = 1; |
} |
} |
else |
echo "<b>Could not connect to SQL database</b><br>\n"; |
}while($stop == 0); |
} |
else{ |
if (is_file("../lib/sql/drivers/$config[sql_type]/functions.php")) |
include_once("../lib/sql/drivers/$config[sql_type]/functions.php"); |
else{ |
echo "<b>Could not include SQL library</b><br>\n"; |
exit(); |
} |
unset($member_groups); |
$link = da_sql_pconnect($config); |
if ($link){ |
$res = da_sql_query($link,$config, |
"SELECT DISTINCT groupname FROM $config[sql_usergroup_table];"); |
if ($res){ |
while(($row = da_sql_fetch_array($res,$config))) |
$member_groups[] = $row['groupname']; |
} |
else |
echo "<b>Database query failed: " . da_sql_error($link,$config) . "</b><br>\n"; |
} |
else |
echo "<b>Could not connect to SQL database</b><br>\n"; |
} |
?> |
/web/acc/manager/lib/sql/delete_group.php |
---|
5,15 → 5,15 |
echo "<b>Could not include SQL library</b><br>\n"; |
exit(); |
} |
$link = @da_sql_pconnect($config); |
$link = da_sql_pconnect($config); |
if ($link){ |
$res = @da_sql_query($link,$config, |
$res = da_sql_query($link,$config, |
"DELETE FROM $config[sql_groupreply_table] WHERE groupname = '$login';"); |
if ($res){ |
$res = @da_sql_query($link,$config, |
$res = da_sql_query($link,$config, |
"DELETE FROM $config[sql_groupcheck_table] WHERE groupname = '$login';"); |
if ($res){ |
$res = @da_sql_query($link,$config, |
$res = da_sql_query($link,$config, |
"DELETE FROM $config[sql_usergroup_table] WHERE groupname = '$login';"); |
if ($res) |
echo "<b>Le groupe $login a été correctement supprimé</b><br>\n"; |
/web/acc/manager/lib/sql/delete_user.php |
---|
5,20 → 5,20 |
echo "<b>Could not include SQL library</b><br>\n"; |
exit(); |
} |
$link = @da_sql_pconnect($config); |
$link = da_sql_pconnect($config); |
if ($link){ |
$res = @da_sql_query($link,$config, |
$res = da_sql_query($link,$config, |
"DELETE FROM $config[sql_reply_table] WHERE username = '$login';"); |
if ($res){ |
$res = @da_sql_query($link,$config, |
$res = da_sql_query($link,$config, |
"DELETE FROM $config[sql_check_table] WHERE username = '$login';"); |
if ($res){ |
$res = @da_sql_query($link,$config, |
$res = da_sql_query($link,$config, |
"DELETE FROM $config[sql_usergroup_table] WHERE username = '$login';"); |
if (!$res) |
echo "<b>Error deleting user $login from user group table: " . da_sql_error($link,$config) . "</b><br>\n"; |
if ($config[sql_use_user_info_table] == 'true'){ |
$res = @da_sql_query($link,$config, |
if ($config['sql_use_user_info_table'] == 'true'){ |
$res = da_sql_query($link,$config, |
"DELETE FROM $config[sql_user_info_table] WHERE username = '$login';"); |
if ($res) |
echo "<b>L'usager $login a été correctement supprimé</b><br>\n"; |
/web/acc/manager/lib/sql/drivers/mysql/functions.php |
---|
16,90 → 16,89 |
function da_sql_host_connect($server,$config) |
{ |
if ($config[sql_use_http_credentials] == 'yes'){ |
if ($config['sql_use_http_credentials'] == 'yes'){ |
global $HTTP_SERVER_VARS; |
$SQL_user = $HTTP_SERVER_VARS["PHP_AUTH_USER"]; |
$SQL_passwd = $HTTP_SERVER_VARS["PHP_AUTH_PW"]; |
} |
else{ |
$SQL_user = $config[sql_username]; |
$SQL_passwd = $config[sql_password]; |
$SQL_user = $config['sql_username']; |
$SQL_passwd = $config['sql_password']; |
} |
if ($config[sql_connect_timeout] != 0) |
@ini_set('mysql.connect_timeout',$config[sql_connect_timeout]); |
if ($config[sql_debug] == 'true') |
if ($config['sql_connect_timeout'] != 0) |
ini_set('mysql.connect_timeout',$config['sql_connect_timeout']); |
if ($config['sql_debug'] == 'true') |
print "<b>DEBUG(SQL,MYSQL DRIVER): Connect: User=$SQL_user,Password=$SQL_passwd </b><br>\n"; |
return @mysql_connect("$server:$config[sql_port]",$SQL_user,$SQL_passwd); |
return mysqli_connect("$server:$config[sql_port]",$SQL_user,$SQL_passwd,$config['sql_database']); |
} |
function da_sql_connect($config) |
{ |
if ($config[sql_use_http_credentials] == 'yes'){ |
if (isset($config['sql_use_http_credentials']) && $config['sql_use_http_credentials'] == 'yes'){ |
global $HTTP_SERVER_VARS; |
$SQL_user = $HTTP_SERVER_VARS["PHP_AUTH_USER"]; |
$SQL_passwd = $HTTP_SERVER_VARS["PHP_AUTH_PW"]; |
} |
else{ |
$SQL_user = $config[sql_username]; |
$SQL_passwd = $config[sql_password]; |
$SQL_user = $config['sql_username']; |
$SQL_passwd = $config['sql_password']; |
} |
if ($config[sql_connect_timeout] != 0) |
@ini_set('mysql.connect_timeout',$config[sql_connect_timeout]); |
if ($config[sql_debug] == 'true') |
if ($config['sql_connect_timeout'] != 0) |
ini_set('mysql.connect_timeout',$config['sql_connect_timeout']); |
if ($config['sql_debug'] == 'true') |
print "<b>DEBUG(SQL,MYSQL DRIVER): Connect: User=$SQL_user,Password=$SQL_passwd </b><br>\n"; |
return @mysql_connect("$config[sql_server]:$config[sql_port]",$SQL_user,$SQL_passwd); |
return mysqli_connect("$config[sql_server]:$config[sql_port]",$SQL_user,$SQL_passwd,$config['sql_database']); |
} |
function da_sql_pconnect($config) |
{ |
if ($config[sql_use_http_credentials] == 'yes'){ |
if (isset($config['sql_use_http_credentials']) && $config['sql_use_http_credentials'] == 'yes'){ |
global $HTTP_SERVER_VARS; |
$SQL_user = $HTTP_SERVER_VARS["PHP_AUTH_USER"]; |
$SQL_passwd = $HTTP_SERVER_VARS["PHP_AUTH_PW"]; |
} |
else{ |
$SQL_user = $config[sql_username]; |
$SQL_passwd = $config[sql_password]; |
$SQL_user = $config['sql_username']; |
$SQL_passwd = $config['sql_password']; |
} |
if ($config[sql_connect_timeout] != 0) |
@ini_set('mysql.connect_timeout',$config[sql_connect_timeout]); |
if ($config[sql_debug] == 'true') |
if ($config['sql_connect_timeout'] != 0) |
ini_set('mysql.connect_timeout',$config['sql_connect_timeout']); |
if ($config['sql_debug'] == 'true') |
print "<b>DEBUG(SQL,MYSQL DRIVER): Connect: User=$SQL_user,Password=$SQL_passwd </b><br>\n"; |
return @mysql_pconnect("$config[sql_server]:$config[sql_port]",$SQL_user,$SQL_passwd); |
return mysqli_connect($config['sql_server'],$SQL_user,$SQL_passwd,$config['sql_database'],$config['sql_port']); |
} |
function da_sql_close($link,$config) |
{ |
return @mysql_close($link); |
return mysqli_close($link); |
} |
function da_sql_escape_string($string) |
function da_sql_escape_string($link, $string) |
{ |
return @mysql_real_escape_string($string); |
return mysqli_real_escape_string($link, $string); |
} |
function da_sql_query($link,$config,$query) |
{ |
if ($config[sql_debug] == 'true') |
if ($config['sql_debug'] == 'true') |
print "<b>DEBUG(SQL,MYSQL DRIVER): Query: <i>$query</i></b><br>\n"; |
return @mysql_db_query($config[sql_database],$query,$link); |
return mysqli_query($link,$query); |
} |
function da_sql_num_rows($result,$config) |
{ |
if ($config[sql_debug] == 'true') |
print "<b>DEBUG(SQL,MYSQL DRIVER): Query Result: Num rows:: " . @mysql_num_rows($result) . "</b><br>\n"; |
return @mysql_num_rows($result); |
if ($config['sql_debug'] == 'true') |
print "<b>DEBUG(SQL,MYSQL DRIVER): Query Result: Num rows:: " . mysqli_num_rows($result) . "</b><br>\n"; |
return mysqli_num_rows($result); |
} |
function da_sql_fetch_array($result,$config) |
{ |
$row = array_change_key_case(@mysql_fetch_array($result, |
MYSQL_ASSOC),CASE_LOWER); |
if ($config[sql_debug] == 'true'){ |
$row = @array_change_key_case(mysqli_fetch_array($result, |
MYSQLI_ASSOC),CASE_LOWER); |
if ($config['sql_debug'] == 'true'){ |
print "<b>DEBUG(SQL,MYSQL DRIVER): Query Result: <pre>"; |
print_r($row); |
print "</b></pre>\n"; |
109,28 → 108,28 |
function da_sql_affected_rows($link,$result,$config) |
{ |
if ($config[sql_debug] == 'true') |
print "<b>DEBUG(SQL,MYSQL DRIVER): Query Result: Affected rows:: " . @mysql_affected_rows($result) . "</b><br>\n"; |
return @mysql_affected_rows($link); |
if ($config['sql_debug'] == 'true') |
print "<b>DEBUG(SQL,MYSQL DRIVER): Query Result: Affected rows:: " . mysqli_affected_rows($result) . "</b><br>\n"; |
return mysqli_affected_rows($link); |
} |
function da_sql_list_fields($table,$link,$config) |
{ |
return @mysql_list_fields($config[sql_database],$table); |
return da_sql_query($link, $config, "SHOW COLUMNS FROM $table"); |
} |
function da_sql_num_fields($fields,$config) |
{ |
return @mysql_num_fields($fields); |
return mysqli_num_fields($fields); |
} |
function da_sql_field_name($fields,$num,$config) |
{ |
return @mysql_field_name($fields,$num); |
return mysqli_fetch_field_direct($fields,$num); |
} |
function da_sql_error($link,$config) |
{ |
return @mysql_error($link); |
return mysqli_error($link); |
} |
?> |
/web/acc/manager/lib/sql/find.php |
---|
8,18 → 8,19 |
unset($found_users); |
$link = @da_sql_pconnect($config); |
$link = da_sql_pconnect($config); |
if ($link){ |
$search = da_sql_escape_string($search); |
if (!is_numeric($max)) |
$search = da_sql_escape_string($link, $search); |
if (!isset($max) || !is_numeric($max)) |
# $max = 10; |
# modif by MG fo Alcasar |
$max = 40; |
if ($max > 500) |
$max = 10; |
if (($search_IN == 'name' || $search_IN == 'department' || $search_IN == 'username') && |
$config[sql_use_user_info_table] == 'true'){ |
$res = @da_sql_query($link,$config, |
$config['sql_use_user_info_table'] == 'true'){ |
$res = da_sql_query($link,$config, |
"SELECT " . da_sql_limit($max,0,$config) . " username FROM $config[sql_user_info_table] WHERE |
lower($search_IN) LIKE '%$search%' " . |
# da_sql_limit($max,1,$config) . " " . da_sql_limit($max,2,$config) . " ;"); |
26,8 → 27,8 |
# modif by MG for Alcasar |
da_sql_limit($max,1,$config) . " " . da_sql_limit($max,1,$config) . " ;"); |
if ($res){ |
while(($row = @da_sql_fetch_array($res,$config))) |
$found_users[] = $row[username]; |
while(($row = da_sql_fetch_array($res,$config))) |
$found_users[] = $row['username']; |
} |
else |
"<b>Database query failed: " . da_sql_error($link,$config) . "</b><br>\n"; |
38,15 → 39,15 |
$attrmap["$radius_attr"] = $radius_attr; |
$attr_type["$radius_attr"] = 'replyItem'; |
} |
$table = ($attr_type[$radius_attr] == 'checkItem') ? $config[sql_check_table] : $config[sql_reply_table]; |
$table = ($attr_type[$radius_attr] == 'checkItem') ? $config['sql_check_table'] : $config['sql_reply_table']; |
$attr = $attrmap[$radius_attr]; |
$attr = da_sql_escape_string($attr); |
$res = @da_sql_query($link,$config, |
$attr = da_sql_escape_string($link, $attr); |
$res = da_sql_query($link,$config, |
"SELECT " . da_sql_limit($max,0,$config) . " username FROM $table WHERE attribute = '$attr' |
AND value LIKE '%$search%' " . da_sql_limit($max,1,$config) . " " . da_sql_limit($max,2,$config) . " ;"); |
if ($res){ |
while(($row = @da_sql_fetch_array($res,$config))) |
$found_users[] = $row[username]; |
while(($row = da_sql_fetch_array($res,$config))) |
$found_users[] = $row['username']; |
} |
else |
"<b>Database query failed: " . da_sql_error($link,$config) . "</b><br>\n"; |
/web/acc/manager/lib/sql/functions.php |
---|
0,0 → 1,35 |
<?php |
if (is_file("../lib/sql/drivers/$config[sql_type]/functions.php")) |
include_once("../lib/sql/drivers/$config[sql_type]/functions.php"); |
else{ |
echo "<b>Could not include SQL library</b><br>\n"; |
exit(); |
} |
require_once('../lib/xlat.php'); |
function connect2db($config) |
{ |
$link=da_sql_pconnect($config); |
return $link; |
} |
function get_user_info($link,$user,$config) |
{ |
if ($link && $config['sql_use_user_info_table'] == 'true'){ |
$user = da_sql_escape_string($link, $user); |
$res=da_sql_query($link,$config, |
"SELECT name FROM $config[sql_user_info_table] WHERE username = '$user';"); |
if ($res){ |
$row = da_sql_fetch_array($res,$config); |
if ($row) |
return $row['name']; |
} |
} |
} |
function closedb($link,$config) |
{ |
return 1; |
} |
?> |
/web/acc/manager/lib/sql/group_admin.php |
---|
0,0 → 1,46 |
<?php |
if (is_file("../lib/sql/drivers/$config[sql_type]/functions.php")) |
include_once("../lib/sql/drivers/$config[sql_type]/functions.php"); |
else{ |
echo "<b>Could not include SQL library</b><br>\n"; |
exit(); |
} |
$link = da_sql_pconnect($config); |
if ($link){ |
if (isset($del_members)){ |
foreach ($del_members as $del){ |
$del = da_sql_escape_string($link, $del); |
$res = da_sql_query($link,$config, |
"DELETE FROM $config[sql_usergroup_table] WHERE username = '$del' AND groupname = '$login';"); |
if (!$res) |
echo "<b>Could not delete user $del from group: " . da_sql_error($link,$config) . "</b><br>\n"; |
} |
} |
if ($new_members != ''){ |
$Members = preg_split("/[\n\s]+/",$new_members,-1,PREG_SPLIT_NO_EMPTY); |
if (!empty($Members)){ |
foreach ($Members as $new_member){ |
$new_member = da_sql_escape_string($link, $new_member); |
$res = da_sql_query($link,$config, |
"SELECT username FROM $config[sql_usergroup_table] WHERE |
username = '$new_member' AND groupname = '$login';"); |
if ($res){ |
if (da_sql_num_rows($res,$config)) |
echo "<b>User $new_member already is a member of the group</b><br>\n"; |
else{ |
$res = da_sql_query($link,$config, |
"INSERT INTO $config[sql_usergroup_table] (groupname,username) |
VALUES ('$login','$new_member');"); |
if (!$res) |
echo "<b>Error while adding user $new_member to group: " . da_sql_error($link,$config) . "</b><br>\n"; |
} |
} |
else |
echo "<b>Could not add new member $new_member: " . da_sql_error($link,$config) . "</b><br>\n"; |
} |
} |
} |
} |
else |
echo "<b>Could not connect to SQL database</b><br>\n"; |
?> |
/web/acc/manager/lib/sql/group_change.php |
---|
0,0 → 1,40 |
<?php |
if (is_file("../lib/sql/drivers/$config[sql_type]/functions.php")) |
include_once("../lib/sql/drivers/$config[sql_type]/functions.php"); |
else{ |
echo "<b>Could not include SQL library</b><br>\n"; |
exit(); |
} |
$link = da_sql_pconnect($config); |
if ($link){ |
if (isset($member_groups) && isset($edited_groups)){ |
$del_groups = array_diff($member_groups,$edited_groups); |
if (isset($del_groups)){ |
foreach ($del_groups as $del){ |
$del = da_sql_escape_string($del); |
$res = da_sql_query($link,$config, |
"DELETE FROM $config[sql_usergroup_table] WHERE username = '$login' AND groupname = '$del';"); |
if (!$res) |
echo "<b>Could not delete user $login from group $del: " . da_sql_error($link,$config) . "</b><br>\n"; |
else |
echo "<b>User $login deleted from group $del</b><br>\n"; |
} |
} |
$new_groups = array_diff($edited_groups,$member_groups); |
if (isset($new_groups)){ |
foreach($new_groups as $new){ |
$new = da_sql_escape_string($new); |
$res = da_sql_query($link,$config, |
"INSERT INTO $config[sql_usergroup_table] (groupname,username) |
VALUES ('$new','$login');"); |
if (!$res) |
echo "<b>Error while adding user $login to group $login: " . da_sql_error($link,$config) . "</b><br>\n"; |
else |
echo "<b>User $login added to group $new</b><br>\n"; |
} |
} |
} |
} |
else |
echo "<b>Could not connect to SQL database</b><br>\n"; |
?> |
/web/acc/manager/lib/sql/group_info.php |
---|
6,7 → 6,7 |
echo "<b>Could not include SQL library</b><br>\n"; |
exit(); |
} |
if ($config[sql_use_operators] == 'true'){ |
if ($config['sql_use_operators'] == 'true'){ |
$op = ',op'; |
$use_op = 1; |
}else{ |
14,18 → 14,18 |
$use_op = 0; |
} |
$group_exists = 'no'; |
$link = @da_sql_pconnect($config); |
$link = da_sql_pconnect($config); |
if ($link){ |
if ($login == ''){ |
if (!isset($login) || $login == ''){ |
unset($existing_groups); |
$res = @da_sql_query($link,$config, |
$res = da_sql_query($link,$config, |
"SELECT COUNT(*) as counter,groupname FROM $config[sql_usergroup_table] |
GROUP BY groupname;"); |
if ($res){ |
while(($row = @da_sql_fetch_array($res,$config))){ |
$name = $row[groupname]; |
$existing_groups["$name"] = $row[counter]; |
while(($row = da_sql_fetch_array($res,$config))){ |
$name = $row['groupname']; |
$existing_groups["$name"] = $row['counter']; |
} |
if (isset($existing_groups)) |
ksort($existing_groups); |
39,14 → 39,15 |
unset($group_members); |
unset($existing_groups); |
$res = @da_sql_query($link,$config, |
$res = da_sql_query($link,$config, |
"SELECT attribute,value $op FROM $config[sql_groupcheck_table] WHERE groupname = '$login';"); |
if ($res){ |
if (@da_sql_num_rows($res,$config)) |
if (da_sql_num_rows($res,$config)) |
$group_exists = 'yes'; |
while(($row = @da_sql_fetch_array($res,$config))){ |
$attr = $row[attribute]; |
$val = $row[value]; |
while(($row = da_sql_fetch_array($res,$config))){ |
$attr = $row['attribute']; |
$val = $row['value']; |
if(!isset($tmp["$attr"]['count'])) $tmp["$attr"]['count'] = 0; |
/*Ajout en vue de l'impression des données (thank's to Geoffroy MUSITELLI)*/ |
if($attr == "Max-All-Session") $mas_imp = $val; |
if($attr == "Max-Daily-Session") $mds_imp = $val; |
54,40 → 55,41 |
if($attr == "Expiration") $Expiration = $val; |
/*Fin Ajout*/ |
if ($use_op){ |
$oper = $row[op]; |
$tmp["$attr"][operator][]="$oper"; |
$oper = $row['op']; |
$tmp["$attr"]['operator'][]="$oper"; |
} |
$tmp["$attr"][]="$val"; |
$tmp["$attr"][count]++; |
$tmp["$attr"]['count']++; |
} |
$res = @da_sql_query($link,$config, |
$res = da_sql_query($link,$config, |
"SELECT attribute,value $op FROM $config[sql_groupreply_table] WHERE groupname = '$login';"); |
if ($res){ |
if (@da_sql_num_rows($res,$config)) |
if (da_sql_num_rows($res,$config)) |
$group_exists = 'yes'; |
while(($row = @da_sql_fetch_array($res,$config))){ |
$attr = $row[attribute]; |
$val = $row[value]; |
while(($row = da_sql_fetch_array($res,$config))){ |
$attr = $row['attribute']; |
$val = $row['value']; |
if(!isset($tmp["$attr"]['count'])) $tmp["$attr"]['count'] = 0; |
/*Ajout en vue de l'impression des données (thank's to Geoffroy MUSITELLI)*/ |
if($attr == "Session-Timeout") $sto_imp = $val; |
/*Fin Ajout*/ |
if ($use_op){ |
$oper = $row[op]; |
$tmp["$attr"][operator][]="$oper"; |
$oper = $row['op']; |
$tmp["$attr"]['operator'][]="$oper"; |
} |
$tmp["$attr"][] = "$val"; |
$tmp["$attr"][count]++; |
$tmp["$attr"]['count']++; |
} |
} |
else |
echo "<b>Database query failed partially: " . da_sql_error($link,$config) . "</b><br>\n"; |
$res = @da_sql_query($link,$config, |
$res = da_sql_query($link,$config, |
"SELECT username FROM $config[sql_usergroup_table] WHERE groupname = '$login' ORDER BY username;"); |
if ($res){ |
if (@da_sql_num_rows($res,$config)) |
if (da_sql_num_rows($res,$config)) |
$group_exists = 'yes'; |
while(($row = @da_sql_fetch_array($res,$config))){ |
$member = $row[username]; |
while(($row = da_sql_fetch_array($res,$config))){ |
$member = $row['username']; |
$group_members[] = "$member"; |
} |
} |
105,9 → 107,9 |
$rev_attrmap["$val"] = $key; |
} |
$item_vals["$key"] = $tmp[$val]; |
$item_vals["$key"][count] = $tmp[$val][count]; |
$item_vals["$key"]['count'] = $tmp[$val]['count']; |
if ($use_op) |
$item_vals["$key"][operator] = $tmp[$val][operator]; |
$item_vals["$key"]['operator'] = $tmp[$val]['operator']; |
} |
} |
} |
/web/acc/manager/lib/sql/nas_list.php |
---|
0,0 → 1,62 |
<?php |
require('/etc/freeradius-web/config.php'); |
require_once('../lib/functions.php'); |
unset($da_name_cache); |
if (isset($_SESSION['da_name_cache'])) |
$da_name_cache = $_SESSION['da_name_cache']; |
if ($config[sql_nas_table] != ''){ |
if (is_file("../lib/sql/drivers/$config[sql_type]/functions.php")) |
include_once("../lib/sql/drivers/$config[sql_type]/functions.php"); |
else{ |
echo "<b>Could not include SQL library</b><br>\n"; |
exit(); |
} |
$link = da_sql_pconnect($config); |
if ($link){ |
$auth_user = $_SERVER["PHP_AUTH_USER"]; |
$extra = ''; |
if (isset($mappings[$auth_user][nasdb])){ |
$NAS_ARR = array(); |
$NAS_ARR = preg_split('/,/',$mappings[$auth_user][nasdb]); |
$extra = 'WHERE nasname IN ('; |
foreach ($NAS_ARR as $nas) |
$extra .= "'$nasname',"; |
unset($NAS_ARR); |
$extra = rtrim($extra,","); |
$extra .= ')'; |
} |
$search = da_sql_query($link,$config, |
"SELECT * FROM $config[sql_nas_table] $extra;"); |
if ($search){ |
while($row = da_sql_fetch_array($search,$config)){ |
$num = 0; |
$my_nas_name = $row['nasname']; |
if ($my_nas_name != ''){ |
$nas_list[$my_nas_name]['name'] = $my_nas_name; |
$nas_server = $da_name_cache[$my_nas_name]; |
if (!isset($nas_server)){ |
if (!check_ip($my_nas_name)) |
$nas_server = @gethostbyname($my_nas_name); |
else |
$nas_server = $my_nas_name; |
if (!isset($da_name_cache) && $config[general_use_session] == 'yes'){ |
$da_name_cache[$my_nas_name] = $nas_server; |
session_register('da_name_cache'); |
} |
} |
if ($nas_server != $my_nas_name || check_ip($nas_server)) |
$nas_list[$my_nas_name]['ip'] = $nas_server; |
$nas_list[$my_nas_name]['port_num'] = $row['ports']; |
$nas_list[$my_nas_name]['community'] = $row['community']; |
$nas_list[$my_nas_name]['model'] = $row['description']; |
} |
} |
} |
} |
else |
echo "<b>Could not connect to SQL database</b><br>\n"; |
} |
?> |
/web/acc/manager/lib/sql/password_check.php |
---|
7,17 → 7,17 |
exit(); |
} |
if ($action == 'checkpass'){ |
$link = @da_sql_pconnect($config); |
if (isset($action) && $action == 'checkpass'){ |
$link = da_sql_pconnect($config); |
if ($link){ |
$res = @da_sql_query($link,$config, |
$res = da_sql_query($link,$config, |
"SELECT attribute,value FROM $config[sql_check_table] WHERE username = '$login' |
AND attribute = '$config[sql_password_attribute]';"); |
if ($res){ |
$row = @da_sql_fetch_array($res,$config); |
$row = da_sql_fetch_array($res,$config); |
if (is_file("../lib/crypt/$config[general_encryption_method].php")){ |
include("../lib/crypt/$config[general_encryption_method].php"); |
$enc_passwd = $row[value]; |
$enc_passwd = $row['value']; |
$passwd = da_encrypt($passwd,$enc_passwd); |
if ($passwd == $enc_passwd) |
$msg = '<font color=blue><b>YES It is that</b></font>'; |
/web/acc/manager/lib/sql/user_info.php |
---|
0,0 → 1,122 |
<?php |
require('../lib/sql/attrmap.php'); |
if (is_file("../lib/sql/drivers/$config[sql_type]/functions.php")) |
include_once("../lib/sql/drivers/$config[sql_type]/functions.php"); |
else{ |
echo "<b>Could not include SQL library</b><br>\n"; |
exit(); |
} |
if ($config['sql_use_operators'] == 'true'){ |
$op = ',op'; |
$use_op = 1; |
}else{ |
$op = ""; |
$use_op = 0; |
} |
$user_exists = 'no'; |
$cn = '-'; |
$cn_lang = '-'; |
$address = '-'; |
$address_lang = '-'; |
$homeaddress = '-'; |
$homeaddress_lang = '-'; |
$fax = '-'; |
$url = '-'; |
$ou = '-'; |
$ou_lang = '-'; |
$title = '-'; |
$title_lang = '-'; |
$telephonenumber = '-'; |
$homephone = '-'; |
$mobile = '-'; |
$mail = '-'; |
$mailalt = '-'; |
$user_password_exists = 'no'; |
unset($item_vals); |
unset($tmp); |
$link = da_sql_pconnect($config); |
if ($link){ |
$res = da_sql_query($link,$config, |
"SELECT attribute,value $op FROM $config[sql_check_table] WHERE username = '$login';"); |
if ($res){ |
if (da_sql_num_rows($res,$config)) |
$user_exists = 'yes'; |
while(($row = da_sql_fetch_array($res,$config))){ |
$attr = $row['attribute']; |
$val = $row['value']; |
if(!isset($tmp["$attr"]['count'])) $tmp["$attr"]['count'] = 0; |
if ($attr == $config['sql_password_attribute'] && $val != '') |
$user_password_exists = 'yes'; |
if ($use_op){ |
$oper = $row['op']; |
$tmp["$attr"]['operator'][]="$oper"; |
} |
$tmp["$attr"][]="$val"; |
$tmp["$attr"]['count']++; |
} |
$res = da_sql_query($link,$config, |
"SELECT attribute,value $op FROM $config[sql_reply_table] WHERE username = '$login';"); |
if ($res){ |
if (da_sql_num_rows($res,$config)) |
$user_exists = 'yes'; |
while(($row = da_sql_fetch_array($res,$config))){ |
$attr = $row['attribute']; |
$val = $row['value']; |
if(!isset($tmp["$attr"]['count'])) $tmp["$attr"]['count'] = 0; |
if ($use_op){ |
$oper = $row['op']; |
$tmp["$attr"]['operator'][]="$oper"; |
} |
$tmp["$attr"][] = "$val"; |
$tmp["$attr"]['count']++; |
} |
if ($config['sql_use_user_info_table'] == 'true'){ |
$res = da_sql_query($link,$config, |
"SELECT * FROM $config[sql_user_info_table] WHERE username = '$login';"); |
if ($res){ |
if (da_sql_num_rows($res,$config)){ |
$user_exists = 'yes'; |
$user_info = 1; |
} |
if (($row = da_sql_fetch_array($res,$config))){ |
$cn = ($row['name'] != '') ? $row['name'] : '-'; |
$telephonenumber = ($row['workphone'] != '') ? $row['workphone'] : '-'; |
$homephone = ($row['homephone'] != '') ? $row['homephone'] : '-'; |
$ou = ($row['department'] != '') ? $row['department'] : '-'; |
$mail = ($row['mail'] != '') ? $row['mail'] : '-'; |
$mobile = ($row['mobile'] != '') ? $row['mobile'] : '-'; |
} |
} |
else |
echo "<b>Database query failed partially: " . da_sql_error($link,$config) . "</b><br>\n"; |
} |
} |
else |
echo "<b>Database query failed partially: " . da_sql_error($link,$config) . "</b><br>\n"; |
if (isset($tmp)){ |
foreach(array_keys($tmp) as $val){ |
if ($val == '') |
continue; |
if(isset($rev_attrmap["$val"])) $key = $rev_attrmap["$val"]; |
if ($key == ''){ |
$key = $val; |
$attrmap["$key"] = $val; |
$attr_type["$key"] = 'replyItem'; |
$rev_attrmap["$val"] = $key; |
} |
$item_vals["$key"] = $tmp[$val]; |
if(isset($tmp["$attr"]['count']) && isset($item_vals["$key"]['count'])) $item_vals["$key"]['count'] = $tmp[$val]['count']; |
if ($use_op) |
$item_vals["$key"]['operator'] = $tmp[$val]['operator']; |
} |
} |
} |
else |
echo "<b>Database query failed: " . da_sql_error($link,$config) . "</b><br>\n"; |
} |
else |
echo "<b>Could not connect to SQL database</b><br>\n"; |
?> |
/web/acc/manager/lib/xlat.php |
---|
0,0 → 1,16 |
<?php |
function xlat($filter,$login,$config) |
{ |
$string = $filter; |
if ($filter != ''){ |
$string = preg_replace('/%u/',$login,$string); |
$string = preg_replace('/%U/',$_SERVER["PHP_AUTH_USER"],$string); |
$string = preg_replace('/%ma/',$mappings[$http_user]['accounting'],$string); |
$string = preg_replace('/%mu/',$mappings[$http_user]['userdb'],$string); |
$string = preg_replace('/%mn/',$mappings[$http_user]['nasdb'],$string); |
$string = preg_replace('/%mN/',$mappings[$http_user]['nasadmin'],$string); |
} |
return $string; |
} |
?> |
/web/acc/phpsysinfo/includes/xml/portail.php |
---|
1,4 → 1,4 |
<?php |
<?php |
/*************************************************************************** |
* Copyright (C) 2006 by phpSysInfo - A PHP System Information Script * |
* http://phpsysinfo.sourceforge.net/ * |
31,21 → 31,20 |
$DB_RADIUS = "radius"; |
$radiuspwd = "J7YI65SW"; |
// Connexion au serveur |
mysql_connect($host, $DB_USER,$radiuspwd) or die("erreur de connexion au serveur"); |
mysql_select_db($DB_RADIUS) or die("erreur de connexion a la base de donnees"); |
// Creation et envoi de la requete |
$mysqli = new mysqli($host, $DB_USER, $radiuspwd, $DB_RADIUS); |
if ($texte == 'user') {$query = "SELECT UserName FROM userinfo";} |
else { $query = "SELECT GroupName FROM radusergroup GROUP BY GroupName";} |
$result = mysql_query($query); |
$result = $mysqli->query($query); |
// Recuperation des resultats |
$strResult = mysql_num_rows($result); |
$strResult = $result->num_rows; |
// Deconnexion de la base de donnees |
mysql_close(); |
$mysqli->close(); |
return $strResult; |
} |
} |
function xml_portail () { |
global $sysinfo; |
$_text = " <Portail>\n" |
// . " <Utilisateur>" . htmlspecialchars( request('user'), ENT_QUOTES ) . "</Utilisateur>\n" |
. " <Utilisateur>" . "</Utilisateur>\n" |
52,9 → 51,9 |
. " <Groupe>" . "</Groupe>\n"; |
// . " <Groupe>" . htmlspecialchars( trim( request('group') ), ENT_QUOTES ) . "</Groupe>\n"; |
$_text .= " </Portail>\n"; |
return $_text; |
} |
} |
// Fonction de test de connectivité internet |
function internetTest($INSTALLEDVERSION){ |
$host = "www.google.com"; # Google Test |
66,7 → 65,7 |
if (!$sock){ |
return false; # Internet access is down |
} |
else { |
else { |
fclose($sock); |
$sock = fsockopen($host2, $port, $num, $error, 2); |
if ($sock){ |
150,12 → 149,12 |
. " </tr>\n" |
. "</table>\n"; |
return $_text; |
} |
} |
function wml_portail () { |
global $XPath; |
global $text; |
$_text = "<card id=\"vitals\" title=\"" . $text['vitals'] . "\">\n" |
. "<p>" . $text['hostname'] . ":<br/>\n" |
. "- " . $XPath->getData( "/phpsysinfo/Vitals/Hostname" ) . "</p>\n" |
170,7 → 169,7 |
. "<p>" . $text['loadavg'] . ":<br/>" |
. "- " . $XPath->getData( "/phpsysinfo/Vitals/LoadAvg" ) . "</p>\n" |
. "</card>\n"; |
return $_text; |
} |
?> |