PBX/ monitoring user settings

Discussion in 'General' started by algisv, May 26, 2010.

  1. algisv

    Joined:
    Mar 8, 2010
    Messages:
    10
    Likes Received:
    0
    I it possble have Non Admnistrator user which can use PBX/monitoring
    Now it has access only to his own phone records.
     
  2. jgutierrez

    Joined:
    Feb 28, 2008
    Messages:
    5,737
    Likes Received:
    0
    Yes, it is possible, you will need to do the following:
    1. cd /var/www/html/modules/monitoring
    2. cp index.php index.php.original
    3. Edit index.php, and find the following section
    Code:
        $extension = $pACL->getUserExtension($_SESSION['elastix_user']);
        $esAdministrador = $pACL->isUserAdministratorGroup($_SESSION['elastix_user']);
        $tmpExtension=$extension;
        if($esAdministrador)
            $extension="[[:digit:]]+";
    
    4. Edit that section, and leave it as:
    Code:
        $extension = $pACL->getUserExtension($_SESSION['elastix_user']);
        $esAdministrador = $pACL->isUserAdministratorGroup($_SESSION['elastix_user']);
        $tmpExtension=$extension;
        if($extension==503)
            $esAdministrador=true;
        if($esAdministrador)
            $extension="[[:digit:]]+";
    
    As you can see the added lines where:
    Code:
        if($extension==503)
            $esAdministrador=true;
    
    Where 503 is the extension that I want it to be able to see all the recorded files on the monitoring menu, so what you will need to do is to create a user on the web interface, and assign it extension 503, or the extension that you would like
     
  3. algisv

    Joined:
    Mar 8, 2010
    Messages:
    10
    Likes Received:
    0
    It is not working well.
    I made changes :

    $extension = $pACL->getUserExtension($_SESSION['elastix_user']);
    $esAdministrador = $pACL->isUserAdministratorGroup($_SESSION['elastix_user']);
    $tmpExtension=$extension;
    // mychange algis on 2010.06.08
    if($extension==211)
    $esAdministrador=true;

    if($esAdministrador)
    $extension="[[:digit:]]+";

    //filtro de fechas
    $smarty->assign("menu","monitoring");
    $smarty->assign("Filter",$arrLang['Filter']);
    //formulario para el filtro
    $arrFormElements = array("date_start" => array("LABEL" => $arrLang["Start Date"],

    I see not the same recordings as administrator does. Your solution is not complete. That else I should change?
     
  4. jgutierrez

    Joined:
    Feb 28, 2008
    Messages:
    5,737
    Likes Received:
    0
    And I assume that you have already created an user on the web interface associated to extension 211, else it wont work, and you will have the same results as before. Have you done that?
     
  5. algisv

    Joined:
    Mar 8, 2010
    Messages:
    10
    Likes Received:
    0
    You are right. I missed extention. I created user with 211 and evething goes ok.
    Thanks for help.

    Best regards,
    Algis
     
  6. johnme

    Joined:
    Nov 28, 2008
    Messages:
    148
    Likes Received:
    0
    Re: Re:pBX/ monitoring user settings

    Hi

    In elastix 2.0.2

    find in /var/www/html/modules/monitoring/index.php

    $extension = $pACL->getUserExtension($user);
    $esAdministrador = $pACL->isUserAdministratorGroup($user);

    and make it like:


    $extension = $pACL->getUserExtension($user);
    $esAdministrador = $pACL->isUserAdministratorGroup($user);
    if($extension==301)
    $esAdministrador=true;

    Bye
    John
     
  7. tfan

    Joined:
    Jan 26, 2011
    Messages:
    3
    Likes Received:
    0
    Re: Re:pBX/ monitoring user settings

    Thanks for this informations
    It works for me fine,
    Just i want to know if possible to add, the "Search option" in the montoring interface.


    Thnaks
     
  8. marcmiranda

    Joined:
    Jan 27, 2011
    Messages:
    5
    Likes Received:
    0
    Re: Re:pBX/ monitoring user settings

    I would also like to know if this function is possible for non-admin groups? :S

    Thanks!
     
  9. marcmiranda

    Joined:
    Jan 27, 2011
    Messages:
    5
    Likes Received:
    0
    I've got it to work, though I'm not too sure if it has any effect somewhere.

    I deleted the else part and just retained the true condition of the If block on: /modules/monitoring/themes/default/filter.tpl

    Code:
    <table width="99%" border="0" cellspacing="0" cellpadding="0" align="center">
        <tr class="letra12">
    
                <td width="6%" align="right">{$date_start.LABEL}: <span  class="required">*</span></td>
                <td width="4%" align="left" nowrap>{$date_start.INPUT}</td>
                <td width="6%" align="right">{$date_end.LABEL}: <span  class="required">*</span></td>
                <td width="4%" align="left" nowrap>{$date_end.INPUT}</td>
                <td width="20%" align="right">
                {$filter_field.LABEL}:&nbsp;&nbsp;{$filter_field.INPUT}&nbsp;&nbsp;{$filter_value.INPUT}
                <input class="button" type="submit" name="show" value="{$SHOW}" />
                </td>
    
        </tr>
    </table>
    I think that it is ok since there's only a select number of users who got access to the monitoring module.

    My problem right now is I want to add another option in the dropdown ($filter_field) that will search for the clid.

    I've added that column already in /modules/monitoring/index.php, reportMonitoring function

    Code:
    In a foreach loop
    $arrTmp[1] = $value['clid'];
    
    In $arrGrid value assignment
    1 => array("name"      => $arrLang["Username"],
                                       "property1" => ""),
    What file/s should I look at for modifying the dropdown ($filter_field) and its search function?

    Thanks and best regards,
    Marc
     
  10. marcmiranda

    Joined:
    Jan 27, 2011
    Messages:
    5
    Likes Received:
    0
    LOL got it

    /modules/monitoring/index.php, createFieldFilter function

    Code:
    $arrFilter = array(
            "src" => $arrLang["Source"],
            "dst" => $arrLang["Destination"],
            "userfield" => $arrLang["Type"],
            "clid" => $arrLang["Username"],
                        );
     
  11. sababa

    Joined:
    Jul 28, 2010
    Messages:
    63
    Likes Received:
    0
    Hi All

    Has anyone gotten this to work (seeing all CDR reports system wide) for a NON Admin user?

    I made the changes you guys did, but it only works if the user is in the administrators group I want the user to be in the operador group.

    Any help is greatly appreciated

    Thanks!
     
  12. johnme

    Joined:
    Nov 28, 2008
    Messages:
    148
    Likes Received:
    0
    Hi

    as i said before

    normal user can see all recordings in monitoring

    find in /var/www/html/modules/monitoring/index.php

    $extension = $pACL->getUserExtension($user);
    $esAdministrador = $pACL->isUserAdministratorGroup($user);

    and make it like:


    $extension = $pACL->getUserExtension($user);
    $esAdministrador = $pACL->isUserAdministratorGroup($user);
    if($extension==300)
    $esAdministrador=true;


    You should change the extension==??? to what you have in your condition otherwise it wond work!

    It works fine for me elastix2 to many instalations

    Bye
    John
     
  13. sababa

    Joined:
    Jul 28, 2010
    Messages:
    63
    Likes Received:
    0
    Does it have to be 3 digits?

    I changed it to my extension number and no luck...
    Should I make the username the same as the extension number?
     
  14. sababa

    Joined:
    Jul 28, 2010
    Messages:
    63
    Likes Received:
    0
    I tried changing the username to my extension number and that doesn't work either

    I don't care about the monitoring I just want to be able ot see all the CDR Reports
    should I be changing cdrreports/index.php ?

    Thanks
     
  15. sababa

    Joined:
    Jul 28, 2010
    Messages:
    63
    Likes Received:
    0
    Got it you need ot edit the index.php inthe cdrreports folder to look like this
    $extension = $pACL->getUserExtension($_SESSION['elastix_user']);
    $esAdministrador = $pACL->isUserAdministratorGroup($_SESSION['elastix_user']);
    $tmpExtension=$extension;
    if($extension==503)
    $esAdministrador=true;
    if($esAdministrador)
    $extension="";

    Thanks for the help
     
  16. mostafa33

    Joined:
    May 25, 2010
    Messages:
    121
    Likes Received:
    0
    i need to add the "search" bar to the monitor page,

    i tried to add the code in the starting of the page but no effect:

    $arrFilter = array(
    "src" => $arrLang["Source"],
    "dst" => $arrLang["Destination"],
    "userfield" => $arrLang["Type"],
    "clid" => $arrLang["Username"],);


    help please
     
  17. yurmetal

    Joined:
    Feb 14, 2011
    Messages:
    77
    Likes Received:
    0
    hey guys. i have added in
    /var/www/html/modules/userlist/index.php
    $arrData[$item["null"]] = "No extension";

    to create a non extension user, to view all CDR's

    but how i can add that "No extension" user to view monitoring.

    i've tried

    /var/www/html/modules/monitoring

    if(extension==No extension)
    $esAdministrador=true;

    i'm using elastix 2.0.3 asterisk 1.6
     
  18. jgutierrez

    Joined:
    Feb 28, 2008
    Messages:
    5,737
    Likes Received:
    0
    Hmmm...
    I will recommend that you take a look at the function: isUserAdministratorGroup
    Located at:
    /var/www/html/libs/paloSantoACL.class.php
     
  19. lionqueen

    Joined:
    Jul 13, 2011
    Messages:
    16
    Likes Received:
    0
    Hi,

    I have added these codes for all groups as administrator with suffix "Admin" for example "OperatorAdmin", "AdvisorAdmin". Users belongs to these group can view all other extensions in monitoring or other modules.

    /var/www/html/libs/paloSantoACL.class.php

    Code:
        
    function isUserAdministratorGroup($username)
    {
        $is=false;
        $idUser = $this->getIdUser($username);
        if($idUser)
        {
            $arrGroup = $this->getMembership($idUser);
    			
            $is = array_key_exists('administrator',$arrGroup);
    			
            /**
            * If Groups are followed with suffix "Admin"
            * we make their rights as administrator
            **/
            foreach ($arrGroup as $group => $value)
            {
                if (substr_compare($group,'Admin', strlen($group) - 5) == 0 )
                {
                    $is = true;
                    break;
                }  
            }
        }
        return $is;
    }
    
     

Share This Page