Subversion Repositories ALCASAR

Compare Revisions

Ignore whitespace Rev 2692 → Rev 2714

/scripts/alcasar-macup.sh
30,7 → 30,14
acctterminatecause=$(echo "$db_res" | cut -f3)
 
if [ "$acctterminatecause" != "User-Request" ]; then
db_query="SELECT attribute, value FROM ((SELECT attribute, value FROM radreply WHERE (attribute='Alcasar-Reconnect-Timeout') AND username='$username') UNION (SELECT attribute, value FROM radgroupreply gr LEFT JOIN radusergroup ug ON gr.groupname = ug.groupname WHERE (attribute='Alcasar-Reconnect-Timeout') AND username = '$username' ORDER BY ug.priority) UNION (SELECT attribute, value FROM radgroupreply WHERE groupname = 'ldap' AND (attribute='Alcasar-Reconnect-Timeout'))) attrs GROUP BY attribute;"
db_query_additionalGroups=''
[ -n "$FILTER_ID" ] && db_query_additionalGroups="( SELECT attribute, value FROM radgroupreply WHERE groupname = '$FILTER_ID' AND (attribute='Alcasar-Reconnect-Timeout') ) UNION "
db_query="SELECT attribute, value FROM ( \
( SELECT attribute, value FROM radreply WHERE username = '$USER_NAME' AND (attribute='Alcasar-Reconnect-Timeout') ) UNION \
( SELECT attribute, value FROM radgroupreply gr LEFT JOIN radusergroup ug ON gr.groupname = ug.groupname WHERE username = '$USER_NAME' AND (attribute='Alcasar-Reconnect-Timeout') ORDER BY ug.priority ) UNION \
$db_query_additionalGroups \
( SELECT attribute, value FROM radgroupreply WHERE groupname = 'default' AND (attribute='Alcasar-Reconnect-Timeout') ) \
) attrs GROUP BY attribute;"
db_res=$(mysql -u root -p"$dbRootPass" -D radius -e "$db_query" -Bs)
 
reconnectTimeout=$(echo "$db_res" | awk '$1 == "Alcasar-Reconnect-Timeout" { print $2 }')