How make user group for extension

Discussion in 'General' started by bwg, Oct 20, 2008.

  1. bwg

    bwg

    Joined:
    Aug 14, 2008
    Messages:
    62
    Likes Received:
    0
    Hi

    I have extensions
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    If add new user for extensions numer 101 type is Operador or Extension and login I see CDR report only this extensions.
    I will for example Extensions 101-102-103 one group. If user 101 login if can see CDR report 101-102-103

    How make this expectation
     
  2. jgutierrez

    Joined:
    Feb 28, 2008
    Messages:
    5,737
    Likes Received:
    0
    what you are asking for is that an user may see the CDR info for all extensions in a particular "group" ?
     
  3. bwg

    bwg

    Joined:
    Aug 14, 2008
    Messages:
    62
    Likes Received:
    0
  4. bwg

    bwg

    Joined:
    Aug 14, 2008
    Messages:
    62
    Likes Received:
    0
    Hi
    I'm wait help
     
  5. jgutierrez

    Joined:
    Feb 28, 2008
    Messages:
    5,737
    Likes Received:
    0
    hello,


    try editing the following line in /var/www/html/libs/paloSantoCDR.class.php

    if(!empty($extension)) $strWhere .= " AND (src='$extension' OR dst='$extension') ";

    in the if statement add some conditions that states that if the logged extension differs from 101, 102, ... 111, send the $strWhere as it is (original query).

    But if the logged extension is 101 or 102 ... or 111, change the query, so the $strWhere variable will show up CDR from other extensions too...

    Don't forget to backup the original file before editing it, ok ?? B)
     
  6. bwg

    bwg

    Joined:
    Aug 14, 2008
    Messages:
    62
    Likes Received:
    0
    Hi jgutierrez

    Maybe very easy but my english not enaught. Please tell me how make I see file

    if(!empty($calltype) && $calltype=="incoming") $strWhere .= " AND channel like '%zap%' ";
    if(!empty($extension)) $strWhere .= " AND (src='$extension' OR dst='$extension') ";

    $query = "SELECT calldate, src, dst, channel, dstchannel, disposition, uniqueid, duration, billsec, accountcode FROM cdr ";
    // Clausula WHERE aqui
    if(!empty($strWhere)) $query .= "WHERE $strWhere ";
    // Limit
    if(!empty($limit)) {
    $query .= " LIMIT $limit OFFSET $offset";
    }

    exapmle group is numbers 101,154,155,177 how make this change in the file
     
  7. jgutierrez

    Joined:
    Feb 28, 2008
    Messages:
    5,737
    Likes Received:
    0
  8. bwg

    bwg

    Joined:
    Aug 14, 2008
    Messages:
    62
    Likes Received:
    0
    Hi

    I'm modify paloSantoCDR.class.php

    // -------------------------------- Modifications done by Jorge Gutierrez, Santiago de Guayaquil - Ecuador, Oct 25 / 2008 -----------------------



    // if(!empty($extension)) $strWhere .= " AND (src='$extension' OR dst='$extension') ";


    if(!empty($extension))
    {
    if ($extension=="103" or $extension=="105" or $extension=="106")
    {
    $strWhere .= " AND ((src='103' OR dst='100') ";
    $strWhere .= " OR (src='105' OR dst='105') ";
    $strWhere .= " OR (src='106' OR dst='106') ";
    }
    else
    $strWhere .= " AND (src='$extension' OR dst='$extension') ";
    }


    // -------------------------------- Modifications done by Jorge Gutierrez, Santiago de Guayaquil - Ecuador, Oct 25 / 2008 -----------------------
    and login 103 but not make a rapor
    [​IMG]

    I think mistake red line and modify this type
    $strWhere .= " AND (src='103' OR dst='100') ";
    but not change
    If login admin the same not generate rapor
     
  9. jgutierrez

    Joined:
    Feb 28, 2008
    Messages:
    5,737
    Likes Received:
    0
    Hi there,

    Yep, seems to me that I have a little mistake :p

    You may contact me at jgutierr_007@hotmail.com , if you want you may give me access into your server to fix the CDR report
     

Share This Page