bug fix #799

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

bug fix #799

Chris Larson-2
hi, i am fairly new to php and to vtiger.  i've recently began working for a company that is using vtiger to replace their current software.  i am hoping to get started by taking on a few bugs and getting familiar with vtiger, hope this can help.  as i am new to this, any comments would be appreciated.
 
Reference to bug 799, Update of vtiger_crm/modules/Users/DetailView.php.  replace the following code at the beginning of the file with the code below.  prevents an error when trying to view user with an empty record field passed, also prevents viewing users that do not exist or have been deleted.  specifically preventing 'last viewed' users that have been deleted from being viewed. 

if(!empty($_REQUEST['record'])) {
        $focus->retrieve($_REQUEST['record']);
}
else
{
        header("Location: index.php?module=Users&action=ListView");
}


----------------


if(!empty($_REQUEST['record']))
{
    $focus->retrieve($_REQUEST['record']);
}
else
{  
    /*
        header("Location: index.php?module=Users&action=ListView");
   
      THIS THROWS ERROR:
        Warning: Cannot modify header information - headers already sent by
        (output started at C:\Program Files\Apache Group\Apache2\htdocs\vtigerCRM4_2\vtigerCRM\XTemplate\xtpl.php:204)
        in C:\Program Files\Apache Group\Apache2\htdocs\vtigerCRM4_2\vtigerCRM\modules\Users\DetailView.php
        on line 44
    */
    
    echo "
        <script type='text/javascript'>
            window.location = 'index.php?module=Users&action=ListView';
        </script>
        ";
}

if( $focus->user_name == "" )
{  
   
    echo "
            <table>
                <tr>
                    <td>
                        <b>User does not exist.</b>
                    </td>
                </tr>
                <tr>
                    <td>
                        <a href='index.php?module=Users&action=ListView'>List Users</a>
                    </td>
                </tr>
            </table>
        ";
    exit;  
}
 
---chris
Loading...