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 |
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
State ⇒ Feedback
Taken from Chuck Hagenbuch
Taken from
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.
------------------------------------------------------------
var_dump($perm) just before that line and see what it says.
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.
State ⇒ Assigned
Assigned to
do.. i have reinstalled horde with cvs checkout, but still the same
error...
New Attachment: permission horde.JPG
is the whole point. Please expand everything and try again.
Once more: what EXACT PHP version are you using?
i am using PHP 5.2.1...
is the whole point. Please expand everything and try again.
Once more: what EXACT PHP version are you using?
New Attachment: permission horde.JPG
-> Permissions and expand the Tickets (whups) tree?
i already give the guest permission show read
the creator permission show read edit delete
the authenticated user show read
-> Permissions and expand the Tickets (whups) tree?
var_dump($permission);
Then see what it outputs.
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
var_dump($permission);
Then see what it outputs.
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.
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;
}
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.
Horde's security. I can't reproduce this. What PHP version are you
using?
Horde's security. I can't reproduce this. What PHP version are you
using?
// 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
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..
State ⇒ Feedback
Priority ⇒ 2. Medium
Priority ⇒ 3. High
State ⇒ Unconfirmed
Queue ⇒ Whups
Summary ⇒ guest can't access tickets whups
Due ⇒ 09/08/2007
Type ⇒ Bug
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