added user group restriction of campaign logins for agents: altered admin.php, vicidial.php and several docs

git-svn-id: svn://192.168.202.10@400 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2006-11-22 18:45:10 +00:00
parent 4e54a9f513
commit 0b20e000bf
8 changed files with 165 additions and 27 deletions
+3
View File
@@ -70,6 +70,9 @@ NOTE: Upgrading from 1.1.12-3 to 2.0.1 is at the bottom
script is only for multi-server systems and is started from new
ADMIN_keepalive_ALL.pl script with option 7 in astguiclient.conf
12. Added the ability to restrict agent logins by user group to a specific set
of campaigns. This is definable in the USER GROUPS section of admin.php
+4 -6
View File
@@ -72,20 +72,16 @@ cd ../asterisk-1.2.12.1
wget http://www.eflo.net/files/amd2.conf
mkdir /etc/asterisk
mv amd2.conf /etc/asterisk/amd.conf
*OPTIONAL*(1.2.12.1) apply the meetme volume control patch
*OPTIONAL*(1.2.12.1 and 1.2.13) apply the meetme volume control patch
wget http://www.eflo.net/files/meetmeadmin_volume_control.patch
patch -p1 < ./meetmeadmin_volume_control.patch
- File to patch: app_meetme.c.c
- File to patch: app_meetme.c
cd ../
(1.2 tree) apply the cli delimiter patch
wget http://www.eflo.net/files/cli_chan_concise_delimiter.patch
patch -p1 < ./cli_chan_concise_delimiter.patch
- File to patch: cli.c
(1.2.12 only, not for 1.2.12.1) - channel.c bug fix - **THERE IS NO FIX FOR ASTERISK 1.2.11**
wget http://www.eflo.net/files/channel.c-42600.patch
patch -p1 < ./channel.c-42600.patch
- File to patch: channel.c
make clean
make
@@ -256,6 +252,8 @@ insert into phones (extension, dialplan_number, voicemail_id, phone_ip, computer
insert into vicidial_users (user,pass,full_name,user_level,user_group,load_leads,campaign_detail,ast_admin_access) values('6666','1234','Admin','9','ADMIN','1','1','1');
insert into vicidial_user_groups (user_group,group_name,allowed_campaigns) values('ADMIN','Administrators',' -ALL-CAMPAIGNS- - -');
insert into conferences values('8600001','10.10.10.15','');
insert into conferences values('8600002','10.10.10.15','');
insert into conferences values('8600003','10.10.10.15','');
+4 -6
View File
@@ -829,20 +829,16 @@ with the following patch:
- wget http://www.eflo.net/files/amd2.conf
- mkdir /etc/asterisk
- mv amd2.conf /etc/asterisk/amd.conf
-*OPTIONAL*(1.2.12.1) apply the meetme volume control patch
-*OPTIONAL*(1.2.12.1 or 1.2.14) apply the meetme volume control patch
- wget http://www.eflo.net/files/meetmeadmin_volume_control.patch
- patch -p1 < ./meetmeadmin_volume_control.patch
- File to patch: app_meetme.c.c
- File to patch: app_meetme.c
- cd ../
-(1.2 tree) apply the cli delimiter patch
- wget http://www.eflo.net/files/cli_chan_concise_delimiter.patch
- patch -p1 < ./cli_chan_concise_delimiter.patch
- File to patch: cli.c
-(1.2.12) - channel.c bug fix - **THERE IS NO FIX FOR ASTERISK 1.2.11**
- wget http://www.eflo.net/files/channel.c-42600.patch
- patch -p1 < ./channel.c-42600.patch
- File to patch: channel.c
- make clean
- make
@@ -1598,6 +1594,8 @@ insert into phones (extension, dialplan_number, voicemail_id, phone_ip, computer
insert into vicidial_users (user,pass,full_name,user_level,user_group,load_leads,campaign_detail,ast_admin_access) values('6666','1234','Admin','9','ADMIN','1','1','1');
insert into vicidial_user_groups (user_group,group_name,allowed_campaigns) values('ADMIN','Administrators',' -ALL-CAMPAIGNS- - -');
insert into conferences values('8600001','10.10.10.15','');
insert into conferences values('8600002','10.10.10.15','');
insert into conferences values('8600003','10.10.10.15','');
@@ -431,7 +431,8 @@ index (user)
CREATE TABLE vicidial_user_groups (
user_group VARCHAR(20) NOT NULL,
group_name VARCHAR(40) NOT NULL
group_name VARCHAR(40) NOT NULL,
allowed_campaigns TEXT
);
CREATE TABLE vicidial_campaigns (
+5
View File
@@ -29,3 +29,8 @@ ALTER TABLE vicidial_auto_calls ADD last_update_time TIMESTAMP;
ALTER TABLE vicidial_auto_calls ADD index (last_update_time);
ALTER TABLE vicidial_auto_calls MODIFY call_type ENUM('IN','OUT','OUTBALANCE') default 'OUT';
ALTER TABLE vicidial_user_groups ADD allowed_campaigns TEXT;
UPDATE vicidial_user_groups SET allowed_campaigns=' -ALL-CAMPAIGNS- - -';
@@ -3,6 +3,7 @@
VICIDIAL Server Trunks allows you to restrict the outgoing lines that are used on this server for campaign dialing on a per-campaign basis. You have the option to reserve a specific number of lines to be used by only one campaign as well as allowing that campaign to run over its reserved lines into whatever lines remain open, as long at the total lines used by vicidial on this server is less than the Max VICIDIAL Trunks setting. Not having any of these records will allow the campaign that dials the line first to have as many lines as it can get under the Max VICIDIAL Trunks setting||
VICIDIAL Balance Dialing -<\/B> Setting this field to Y will allow the server to place balance calls for campaigns in VICIDIAL so that the defined dial level can be met even if there are no agents logged into that campaign on this server. Default is N||
VICIDIAL Balance Offlimits -<\/B> This setting defines the number of trunks to not allow VICIDIAL balance dialing to use. For example if you have 40 max vicidial trunks and balance offlimits is set to 10 you will only be able to use 30 trunk lines for VICIDIAL balance dialing. Default is 0||
Allowed Campaigns -<\/B> This is a selectable list of Campaigns to which members of this user group can log in to. The ALL-CAMPAIGNS option allows the users in this group to see and log in to any campaign on the system||
VICIDIAL SERVER TRUNK RECORD NOT ADDED||
there is already a server-trunk record for this campaign||
the number of vicidial trunks is too high||
@@ -28,7 +29,9 @@ VDAC NOT CLEARED FOR CAMPAIGN||
LAST VDAC RECORD CLEARED FOR CAMPAIGN||
VDAC CLEAR CONFIRMATION||
Click here to delete the oldest LIVE record in VDAC for||
Allowed Campaigns||
USERS CAN VIEW ANY CAMPAIGN||
Campaign Not Allowed||
############################################################ CLIENT
@@ -38,7 +41,7 @@ VOLUME||
############################################################ MANAGER Manual
Add notes on balance dialing in Multi-server setups
Add notes for user groups
############################################################ AGENT Manual
+33 -3
View File
@@ -127,6 +127,7 @@
# 60906-1152 - Added Previous CallBack info display span
# 60906-1715 - Allow for Local phone extension conferences
# 61004-1729 - Add ability to control volume per channel in "calls in this session"
# 61122-1341 - Added vicidial_user_groups allowed_campaigns restrictions
#
require("dbconnect.php");
@@ -172,8 +173,8 @@ if (isset($_GET["relogin"])) {$relogin=$_GET["relogin"];}
$forever_stop=0;
$version = '2.0.100';
$build = '61004-1729';
$version = '2.0.101';
$build = '61122-1341';
if ($force_logout)
{
@@ -442,7 +443,7 @@ $VDloginDISPLAY=0;
$login=strtoupper($VD_login);
$password=strtoupper($VD_pass);
##### grab the full name of the agent
$stmt="SELECT full_name,user_level,hotkeys_active,agent_choose_ingroups,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,closer_default_blended from vicidial_users where user='$VD_login' and pass='$VD_pass'";
$stmt="SELECT full_name,user_level,hotkeys_active,agent_choose_ingroups,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,closer_default_blended,user_group from vicidial_users where user='$VD_login' and pass='$VD_pass'";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$LOGfullname=$row[0];
@@ -455,6 +456,7 @@ $VDloginDISPLAY=0;
$VU_vicidial_recording=$row[7];
$VU_vicidial_transfers=$row[8];
$VU_closer_default_blended=$row[9];
$VU_user_group=$row[10];
if ($WeBRooTWritablE > 0)
{
fwrite ($fp, "vdweb|GOOD|$date|$VD_login|$VD_pass|$ip|$browser|$LOGfullname|\n");
@@ -464,6 +466,34 @@ $VDloginDISPLAY=0;
while ( (strlen($user_abb) > 4) and ($forever_stop < 200) )
{$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;}
$stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$VU_user_group';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$LOGallowed_campaigns =$row[0];
if ( (!eregi("$VD_campaign",$LOGallowed_campaigns)) and (!eregi("ALL-CAMPAIGNS",$LOGallowed_campaigns)) )
{
echo "<title>VICIDIAL web client: VICIDIAL Campaign Login</title>\n";
echo "</head>\n";
echo "<BODY BGCOLOR=WHITE MARGINHEIGHT=0 MARGINWIDTH=0>\n";
echo "<TABLE WIDTH=100%><TR><TD></TD>\n";
echo "<!-- INTERNATIONALIZATION-LINKS-PLACEHOLDER-VICIDIAL -->\n";
echo "</TR></TABLE>\n";
echo "<B>Sorry, you are not allowed to login to this campaign: $VD_campaign</B>\n";
echo "<FORM ACTION=\"$PHP_SELF\" METHOD=POST>\n";
echo "<INPUT TYPE=HIDDEN NAME=DB VALUE=\"$DB\">\n";
echo "<INPUT TYPE=HIDDEN NAME=phone_login VALUE=\"$phone_login\">\n";
echo "<INPUT TYPE=HIDDEN NAME=phone_pass VALUE=\"$phone_pass\">\n";
echo "Login: <INPUT TYPE=TEXT NAME=VD_login SIZE=10 MAXLENGTH=20 VALUE=\"$VD_login\">\n<br>";
echo "Password: <INPUT TYPE=PASSWORD NAME=VD_pass SIZE=10 MAXLENGTH=20 VALUE=\"$VD_pass\"><br>\n";
echo "Campaign: $camp_form_code<br>\n";
echo "<INPUT TYPE=SUBMIT NAME=SUBMIT VALUE=SUBMIT>\n";
echo "</FORM>\n\n";
echo "</body>\n\n";
echo "</html>\n\n";
exit;
}
##### check to see that the campaign is active
$stmt="SELECT count(*) FROM vicidial_campaigns where campaign_id='$VD_campaign' and active='Y';";
if ($DB) {echo "|$stmt|\n";}
+109 -9
View File
@@ -455,6 +455,8 @@ if (isset($_GET["dedicated_trunks"])) {$dedicated_trunks=$_GET["dedicated_trunks
elseif (isset($_POST["dedicated_trunks"])) {$dedicated_trunks=$_POST["dedicated_trunks"];}
if (isset($_GET["trunk_restriction"])) {$trunk_restriction=$_GET["trunk_restriction"];}
elseif (isset($_POST["trunk_restriction"])) {$trunk_restriction=$_POST["trunk_restriction"];}
if (isset($_GET["campaigns"])) {$campaigns=$_GET["campaigns"];}
elseif (isset($_POST["campaigns"])) {$campaigns=$_POST["campaigns"];}
@@ -788,12 +790,13 @@ $lead_filter_sql = ereg_replace(";","",$lead_filter_sql);
# 61003-1123 - added functions for vicidial_server_trunks records
# 61109-1022 - added Emergency VDAC Jam Clear function to Campaign Detail screen
# 61110-1502 - add ability to select NONE in dial statuses, new list_id must not be < 100
# 61122-1228 - added user group campaign restrictions
#
# make sure you have added a user to the vicidial_users MySQL table with at least user_level 8 to access this page the first time
$version = '2.0.70';
$build = '61110-1502';
$version = '2.0.71';
$build = '61122-1228';
$STARTtime = date("U");
@@ -835,11 +838,12 @@ $browser = getenv("HTTP_USER_AGENT");
{
$office_no=strtoupper($PHP_AUTH_USER);
$password=strtoupper($PHP_AUTH_PW);
$stmt="SELECT * from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'";
$stmt="SELECT * from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$LOGfullname =$row[3];
$LOGuser_level =$row[4];
$LOGuser_group =$row[5];
$LOGdelete_users =$row[8];
$LOGdelete_user_groups =$row[9];
$LOGdelete_lists =$row[10];
@@ -856,6 +860,11 @@ $browser = getenv("HTTP_USER_AGENT");
$LOGdelete_call_times =$row[32];
$LOGmodify_call_times =$row[33];
$stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$LOGuser_group';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$LOGallowed_campaigns =$row[0];
if ($WeBRooTWritablE > 0)
{
fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n");
@@ -914,6 +923,7 @@ if ($ADD==221111111111) {$hh='server'; echo "ADDING NEW SERVER VICIDIAL TRUNK R
if ($ADD==2111111111111) {$hh='server'; echo "ADDING NEW CONFERENCE";}
if ($ADD==21111111111111) {$hh='server'; echo "ADDING NEW VICIDIAL CONFERENCE";}
if ($ADD==3) {$hh='users'; echo "Modify User";}
if ($ADD==30) {$hh='campaigns'; echo "Campaign Not Allowed";}
if ($ADD==31) {$hh='campaigns'; echo "Modify Campaign";}
if ($ADD==34) {$hh='campaigns'; echo "Modify Campaign - Basic View";}
if ($ADD==311) {$hh='lists'; echo "Modify List";}
@@ -1087,7 +1097,7 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or ($ADD==21) or ($ADD=
$o++;
}
##### get inbound groups listing for checkboxes
##### BEGIN get inbound groups listing for checkboxes #####
if ($ADD==31)
{
$stmt="SELECT closer_campaigns from vicidial_campaigns where campaign_id='$campaign_id';";
@@ -1146,6 +1156,67 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or ($ADD==21) or ($ADD=
}
if (strlen($groups_value)>2) {$groups_value .= " -";}
}
##### END get inbound groups listing for checkboxes #####
##### BEGIN get campaigns listing for checkboxes #####
if ( ($ADD==211111) or ($ADD==311111) or ($ADD==411111) or ($ADD==511111) or ($ADD==611111) )
{
if ( ($ADD==211111) or ($ADD==311111) or ($ADD==511111) or ($ADD==611111) )
{
$stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$user_group';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$allowed_campaigns = $row[0];
$allowed_campaigns = preg_replace("/ -$/","",$allowed_campaigns);
$campaigns = explode(" ", $allowed_campaigns);
echo "<!-- $allowed_campaigns -->";
}
$campaigns_value='';
$campaigns_list='<B><input type="checkbox" name="campaigns[]" value="-ALL-CAMPAIGNS-"';
$p=0;
while ($p<100)
{
if (eregi('ALL-CAMPAIGNS',$campaigns[$p]))
{
$campaigns_list.=" CHECKED";
$campaigns_value .= " -ALL-CAMPAIGNS- -";
}
$p++;
}
$campaigns_list.="> ALL-CAMPAIGNS - USERS CAN VIEW ANY CAMPAIGN</B><BR>\n";
$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id";
$rslt=mysql_query($stmt, $link);
$campaigns_to_print = mysql_num_rows($rslt);
$o=0;
while ($campaigns_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$campaign_id_value = $rowx[0];
$campaign_name_value = $rowx[1];
$campaigns_list .= "<input type=\"checkbox\" name=\"campaigns[]\" value=\"$campaign_id_value\"";
$p=0;
while ($p<100)
{
if ($campaign_id_value == $campaigns[$p])
{
echo "<!-- X $p|$campaign_id_value|$campaigns[$p]| -->";
$campaigns_list .= " CHECKED";
$campaigns_value .= " $campaign_id_value";
}
echo "<!-- O $p|$campaign_id_value|$campaigns[$p]| -->";
$p++;
}
$campaigns_list .= "> $campaign_id_value - $campaign_name_value<BR>\n";
$o++;
}
if (strlen($campaigns_value)>2) {$campaigns_value .= " -";}
}
##### END get campaigns listing for checkboxes #####
if ( (strlen($ADD)==11) or (strlen($ADD)>12) )
{
@@ -1803,6 +1874,11 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN
<BR>
<B>Group Name -</B> This is the description of the vicidial user group max of 40 characters.
<BR>
<A NAME="vicidial_user_groups-allowed_campaigns">
<BR>
<B>Allowed Campaigns -</B> This is a selectable list of Campaigns to which members of this user group can log in to. The ALL-CAMPAIGNS option allows the users in this group to see and log in to any campaign on the system.
@@ -3504,16 +3580,16 @@ if ($ADD==211111)
}
else
{
$stmt="INSERT INTO vicidial_user_groups values('$user_group','$group_name');";
$stmt="INSERT INTO vicidial_user_groups(user_group,group_name,allowed_campaigns) values('$user_group','$group_name','-ALL-CAMPAIGNS-');";
$rslt=mysql_query($stmt, $link);
echo "<br><B>USER GROUP ADDED: $user_start</B>\n";
echo "<br><B>USER GROUP ADDED: $user_group</B>\n";
### LOG CHANGES TO LOG FILE ###
if ($WeBRooTWritablE > 0)
{
$fp = fopen ("./admin_changes_log.txt", "a");
fwrite ($fp, "$date|ADD A NEW USER GROUP ENTRY |$PHP_AUTH_USER|$ip|'$user_group','$group_name'|\n");
fwrite ($fp, "$date|ADD A NEW USER GROUP ENTRY |$PHP_AUTH_USER|$ip|$stmt|\n");
fclose($fp);
}
}
@@ -4340,7 +4416,7 @@ if ($ADD==411111)
}
else
{
$stmt="UPDATE vicidial_user_groups set user_group='$user_group', group_name='$group_name' where user_group='$OLDuser_group';";
$stmt="UPDATE vicidial_user_groups set user_group='$user_group', group_name='$group_name',allowed_campaigns='$campaigns_value' where user_group='$OLDuser_group';";
$rslt=mysql_query($stmt, $link);
echo "<br><B>USER GROUP MODIFIED</B>\n";
@@ -4349,7 +4425,7 @@ if ($ADD==411111)
if ($WeBRooTWritablE > 0)
{
$fp = fopen ("./admin_changes_log.txt", "a");
fwrite ($fp, "$date|MODIFY USER GROUP ENTRY |$PHP_AUTH_USER|$ip|UPDATE vicidial_user_groups set user_group='$user_group', group_name='$group_name' where user_group='$OLDuser_group'|\n");
fwrite ($fp, "$date|MODIFY USER GROUP ENTRY |$PHP_AUTH_USER|$ip|$stmt|\n");
fclose($fp);
}
}
@@ -5865,8 +5941,13 @@ else
if ( ($LOGcampaign_detail < 1) and ($ADD==31) ) {$ADD=34;} # send to Basic if not allowed
if ( ($ADD==31) and ( (!eregi("$campaign_id",$LOGallowed_campaigns)) and (!eregi("ALL-CAMPAIGNS",$LOGallowed_campaigns)) ) )
{$ADD=30;} # send to not allowed screen if not in vicidial_user_groups allowed_campaigns list
if ($ADD==31)
{
if ($stage=='show_dialable')
{
$stmt="UPDATE vicidial_campaigns set display_dialable_count='Y' where campaign_id='$campaign_id';";
@@ -6354,6 +6435,9 @@ if ($LOGdelete_campaigns > 0)
# ADD=34 modify campaign info in the system - Basic View
######################
if ( ($ADD==34) and ( (!eregi("$campaign_id",$LOGallowed_campaigns)) and (!eregi("ALL-CAMPAIGNS",$LOGallowed_campaigns)) ) )
{$ADD=30;} # send to not allowed screen if not in vicidial_user_groups allowed_campaigns list
if ($ADD==34)
{
if ($stage=='show_dialable')
@@ -6579,6 +6663,19 @@ if ($LOGdelete_campaigns > 0)
}
######################
# ADD=31 campaign not allowed
######################
if ($ADD==30)
{
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
echo "You do not have permission to view campaign $campaign_id\n";
}
######################
# ADD=311 modify list info in the system
######################
@@ -7080,6 +7177,9 @@ echo "<input type=hidden name=OLDuser_group value=\"$user_group\">\n";
echo "<center><TABLE width=600 cellspacing=3>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Group: </td><td align=left><input type=text name=user_group size=15 maxlength=20 value=\"$user_group\"> (no spaces or punctuation)$NWB#vicidial_user_groups-user_group$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Description: </td><td align=left><input type=text name=group_name size=40 maxlength=40 value=\"$group_name\"> (description of group)$NWB#vicidial_user_groups-group_name$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Allowed Campaigns: </td><td align=left>\n";
echo "$campaigns_list";
echo "$NWB#vicidial_user_groups-allowed_campaigns$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n";
echo "</TABLE></center>\n";