6.0.0-alpha12
6/12/25

[#5687] guest can't access tickets whups
Summary guest can't access tickets whups
Queue Whups
Type Bug
State No Feedback
Priority 2. Medium
Owners
Requester lee_tao86 (at) yahoo (dot) com
Created 09/03/2007 (6492 days ago)
Due 09/08/2007 (6487 days ago)
Updated 06/15/2009 (5841 days ago)
Assigned 10/03/2007 (6462 days ago)
Resolved 10/18/2007 (6447 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
06/15/2009 03:11:35 AM icyo (at) rave-networks (dot) net Comment #20 Reply to this comment
I get the same problem as lee_tao86 but with whups, klutz, agora and 
scry. I've try the var_dump on $permission as Chuck Hagenbuch suggest 
and get the same " bool(false) ". I try the var_dump on $perm but got 
nothingin the error code. I the suggestion that lee_tao86 gave ( 
change === to == ) and get the same error.



I only see this error with a normal user, admin don't get this error. 
I have already give total permission in the permission tree to the 
user with witch I test this and it doesn't change anything.



Config:

Groupware Webmail edition 1.2.3

- Whups 1.0

- Klutz 1.0.1-cvs

- Agora 1.0-cvs

- Scry 1.0-cvs

- Debian Lenny

- Apache 2.2.9-10

- PHP 5.2.6

- MySQL 5.0.51a-24
10/18/2007 05:52:08 PM Jan Schneider State ⇒ No Feedback
 
10/03/2007 02:48:09 AM Chuck Hagenbuch Comment #19
State ⇒ Feedback
Taken from Chuck Hagenbuch
Taken from Horde DevelopersHorde Developers
Reply to this comment
-----------------------------------------------------------
        if ($perm == false) { ==>> THIS IS THE ERROR.. THE ORIGINAL CODE IS
===, there are three =, after i changed this, whups can run again
with no error.
------------------------------------------------------------
If $perm isn't false then what exactly is it there? - please try 
var_dump($perm) just before that line and see what it says.
10/02/2007 10:41:05 AM Jan Schneider Comment #18 Reply to this comment
Jan, can you reproduce any of this?
No.
10/02/2007 08:30:37 AM lee_tao86 (at) yahoo (dot) com Comment #17 Reply to this comment
dear developer,



i think i finally know what's happening with this problem..



i tried add code print 'connect' in every if { } in the datatree.php 
and finally i reached one function that cause that error.



n Horde/Perms/datatree.php



   function &getPermission($name)

     {

         /* Cache of previously retrieved permissions. */

         static $permsCache = array();



        if (isset($permsCache[$name])) {

            // print 'masuk';

                return $permsCache[$name];

         }



         $perm = $this->_cache->get('perm_' . $name, 
$GLOBALS['conf']['cache']['default_lifetime']);

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

        if ($perm == false) { ==>> THIS IS THE ERROR.. THE ORIGINAL CODE IS 
===, there are three =, after i changed this, whups can run again with 
no error.

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

             $perm = $this->_datatree->getObject($name, 
'DataTreeObject_Permission');

             $this->_cache->set('perm_' . $name, serialize($perm), 
$GLOBALS['conf']['cache']['default_lifetime']);

             $permsCache[$name] = $perm;

         } else {

             $permsCache[$name] = unserialize($perm);

         }



         return $permsCache[$name];

     }



i don't know what's wrong with this..i'm still wondering whether my 
php 5.2.4 support that kind of code..



anyway, i can use whups now. thanks for all your help.


10/02/2007 02:37:42 AM Chuck Hagenbuch Comment #16 Reply to this comment
Jan, can you reproduce any of this?
10/01/2007 11:39:22 PM Jan Schneider Assigned to Chuck Hagenbuch
State ⇒ Assigned
Assigned to Horde DevelopersHorde Developers
 
09/07/2007 06:59:20 AM lee_tao86 (at) yahoo (dot) com Comment #15 Reply to this comment
can someone help me please??because i don't know what else should i 
do.. i have reinstalled horde with cvs checkout, but still the same 
error...


09/06/2007 03:57:18 AM lee_tao86 (at) yahoo (dot) com Comment #14
New Attachment: permission horde.JPG Download
Reply to this comment
That screenshot doesn't show anything that exists below whups, which
is the whole point. Please expand everything and try again.

Once more: what EXACT PHP version are you using?
i am sorry.. this is the new attachment..

i am using PHP 5.2.1...
09/06/2007 03:54:12 AM Chuck Hagenbuch Comment #13 Reply to this comment
That screenshot doesn't show anything that exists below whups, which 
is the whole point. Please expand everything and try again.



Once more: what EXACT PHP version are you using?
09/06/2007 03:53:37 AM Chuck Hagenbuch Deleted Original Message
 
09/06/2007 03:52:21 AM lee_tao86 (at) yahoo (dot) com Comment #12
New Attachment: permission horde.JPG Download
Reply to this comment
What does the permissions tree look like if you go to Administration
-> Permissions and expand the Tickets (whups) tree?
  please see the attachment...



i already give the guest permission show  read

the creator permission show read edit delete

the authenticated user show read


09/06/2007 03:46:03 AM Chuck Hagenbuch Comment #11 Reply to this comment
What does the permissions tree look like if you go to Administration 
-> Permissions and expand the Tickets (whups) tree?
09/06/2007 03:42:22 AM lee_tao86 (at) yahoo (dot) com Comment #10 Reply to this comment
In the line before the error, put:

var_dump($permission);

Then see what it outputs.
i write that code and then the output is:

bool(false)

Fatal error: Call to a member function getUserPermissions() on a 
non-object in /var/www/horde/lib/Horde/Perms/datatree.php on line 252




09/06/2007 03:38:25 AM Chuck Hagenbuch Comment #9 Reply to this comment
In the line before the error, put:



var_dump($permission);



Then see what it outputs.
09/06/2007 03:36:26 AM lee_tao86 (at) yahoo (dot) com Comment #8 Reply to this comment
In a bug report you should be as specific as possible. Just saying
PHP 5 is a tiny bit of information but largely useless. Please be
more specific.

Put in a var_dump of $permission in the line before the fatal error,
see what it is.
how can i put that var_dump??what is the code?i'm sorry my ability in 
coding is not really good T_T.. this is the code:

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

  function getPermissions($permission, $user = null, $creator = null)

     {

         if (!is_a($permission, 'DataTreeObject_Permission')) {

             $permission = &$this->getPermission($permission);

             if (is_a($permission, 'PEAR_Error')) {

                 Horde::logMessage($permission, __FILE__, __LINE__, 
PEAR_LOG_DEBUG);

                 return false;

             }

         }



         if (is_null($user)) {

             $user = Auth::getAuth();



         }



         // If this is a guest user, only check guest permissions.

         if (empty($user)) {

             return $permission->getGuestPermissions();



         }



         // If $creator was specified, check creator permissions.

         if (!is_null($creator)) {

             // If the user is the creator of the event see if there

             // are creator permissions.

             if (strlen($user) && $user === $creator &&

                 ($perms = $permission->getCreatorPermissions()) !== null) {

                 return $perms;

             }

         }

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

     *****THIS IS THE ERROR PART******

    // Check user-level permissions.

  -->        $userperms = $permission->getUserPermissions();

         if (isset($userperms[$user])) {

            return $userperms[$user];

         }

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

         // If no user permissions are found, try group permissions.

         if (isset($permission->data['groups']) &&

             is_array($permission->data['groups']) &&

             count($permission->data['groups'])) {

             require_once 'Horde/Group.php';

             $groups = &Group::singleton();



             $composite_perm = null;

             $type = $permission->get('type');

             foreach ($permission->data['groups'] as $group => $perm) {

                 if ($groups->userIsInGroup($user, $group)) {

                     if (is_null($composite_perm)) {

                         $composite_perm = $type == 'matrix' ? 0 : array();

                     }

                     if ($type == 'matrix') {

                         $composite_perm |= $perm;

                     } else {

                         $composite_perm[] = $perm;

                     }

                 }

             }



             if ($composite_perm !== null) {

                 return $composite_perm;

             }

         }



         // If there are default permissions, return them.

         // if (($perms = $permission->getDefaultPermissions()) !== null) {

         //  return $perms;

         //      }



         // Otherwise, deny all permissions to the object.

         return false;

     }
09/06/2007 03:27:05 AM Chuck Hagenbuch Comment #7 Reply to this comment
In a bug report you should be as specific as possible. Just saying PHP 
5 is a tiny bit of information but largely useless. Please be more 
specific.



Put in a var_dump of $permission in the line before the fatal error, 
see what it is.
09/06/2007 03:22:32 AM lee_tao86 (at) yahoo (dot) com Comment #6 Reply to this comment
No, that's not going to be okay, you've disabled a large portion of
Horde's security. I can't reproduce this. What PHP version are you
using?
  i'm using PHP 5
09/06/2007 03:20:36 AM Chuck Hagenbuch Comment #5 Reply to this comment
No, that's not going to be okay, you've disabled a large portion of 
Horde's security. I can't reproduce this. What PHP version are you 
using?
09/05/2007 04:37:33 AM lee_tao86 (at) yahoo (dot) com Comment #4 Reply to this comment
i already fixed that error by making this code as comment:

// Check user-level permissions.

      -->   // $userperms = $permission->getUserPermissions();

      -->   //if (isset($userperms[$user])) {

      -->   //   return $userperms[$user];

      -->   // }

before, there's no //, and then i got error creating new ticket beside 
administrator, and then, when i give //, i can create ticket with 
other user not administrator..

what i want to ask is will it be okay if that code i disabled?

thx
09/04/2007 01:13:55 AM lee_tao86 (at) yahoo (dot) com Comment #3 Reply to this comment
Are you sure that you are using Horde 3.2?
yup i'm using Horde 3.2 Alpha...when i login as administrator, there 
is nothing wrong with whups, but when i login not as administrator, i 
got that error.. i don't know why it can happen like that...



i already change the permission, but same error...



help me..
09/03/2007 11:14:47 AM Jan Schneider Comment #2
State ⇒ Feedback
Priority ⇒ 2. Medium
Reply to this comment
Are you sure that you are using Horde 3.2?
09/03/2007 07:51:04 AM lee_tao86 (at) yahoo (dot) com Comment #1
Priority ⇒ 3. High
State ⇒ Unconfirmed
Queue ⇒ Whups
Summary ⇒ guest can't access tickets whups
Due ⇒ 09/08/2007
Type ⇒ Bug
Reply to this comment
when i login with different user but not administrator, and then when 
i want to create ticket, i get this error:



Fatal error: Call to a member function getUserPermissions() on a 
non-object in /var/www/horde/lib/Horde/Perms/datatree.php on line 251



please help me....i don't know what should i do anymore because i have 
googling alot but i can't find the answer...

thx

Saved Queries