Forum Moderators: coopster

Message Too Old, No Replies

parse error, unexpected T_VARIABLE . I can`t see why?

I know it must be a sintax error.. but I can`t find it!

         

Isabel

6:17 pm on Feb 13, 2004 (gmt 0)

10+ Year Member



Here is the whole code:

<?php

require_once("config.inc.php");
require_once("LiveUser/Admin/Perm/Container/DB_Medium.php");
require_once("LiveUser/Admin/Auth/Container/DB.php");

$lu_dsn=array("dsn" => $dsn);

$objRightsAdminAuth=new LiveUser_Admin_Auth_Container_DB($lu_dsn, $conf["authContainers"][0]);

$objRightsAdminPerm=new LiveUser_Admin_Perm_Container_DB_Medium($lu_dsn, $conf);

if (!$objRightsAdminPerm->init_ok())
{
    die("impossible to initialize".$objRightsAdminPerm->getMessage());
}

$objRightsAdminPerm->setCurrentLanguage("FR");

// Add a user to the database
// LiveUser design allowing for several containers
// the user must be added to both containers
$user_auth_id=$objRightsAdminAuth->addUser("matty", "easy", true);

if (DB::isError($user_auth_id))
{
    $user_auth_id->getMessage(); //--->This is the line "with the problem" <---
    exit;
}

$objRightsAdminPerm->addUser($user_auth_id);

I really apreciate if somebody can help me!

Thank you

jatar_k

6:26 pm on Feb 13, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld Isabel,

I may need more coffee but I don't see it. I assume it just says T_VARIABLE and it is the line you mentioned? nothing more

Isabel

6:31 pm on Feb 13, 2004 (gmt 0)

10+ Year Member



That's all!

this is the message:

"Parse error: parse error, unexpected T_VARIABLE in /home/mrocha/public_html/LiveUser/admin.php on line 27"

Line 27 is:
    $user_auth_id->getMessage();

coopster

7:08 pm on Feb 13, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



A simple question, but I need to confirm. The script showing is your
admin.php
script, correct?

jatar_k

7:19 pm on Feb 13, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I was wondering the same thing. Smells like trickle down but I don't see that either if that is the admin.php script and that's all there is in the start of it.

[edited by: jatar_k at 7:28 pm (utc) on Feb. 13, 2004]

Isabel

7:20 pm on Feb 13, 2004 (gmt 0)

10+ Year Member



Yes. it is!

It's too strange... don't you think?

Isabel

7:34 pm on Feb 13, 2004 (gmt 0)

10+ Year Member



Here is the entire code for admin.php

<?php

require_once("/usr/share/doc/mrtg-2.9.17/contrib/mrtg_php_portal/conf/config.inc.php");
require_once("/usr/share/pear/LiveUser/Admin/Perm/Container/DB_Medium.php");
require_once("/usr/share/pear/LiveUser/Admin/Auth/Container/DB.php");

$lu_dsn=array("dsn" => $dsn);

$objRightsAdminAuth=new LiveUser_Admin_Auth_Container_DB($lu_dsn, $conf["authContainers"][0]);

$objRightsAdminPerm=new LiveUser_Admin_Perm_Container_DB_Medium($lu_dsn, $conf);

if (!$objRightsAdminPerm->init_ok)
{
die("Error. Conf: " . $conf. " DSN: " . $dsn . " Impossible to initialize" . $objRightsAdminPerm->getMessage );
}

$objRightsAdminPerm->setCurrentLanguage("FR");

// Add a user to the database
// LiveUser design allowing for several containers
// the user must be added to both containers
$user_auth_id=$objRightsAdminAuth->addUser("matty", "easy", true);

if (DB::isError($user_auth_id))
{
$user_auth_id->getMessage();
exit;
}

$objRightsAdminPerm->addUser($user_auth_id);

echo ("$user_id created " . $user_auth_id . "\n");

// create application and areas
$app_id = $objRightsAdminPerm->addApplication('LIVEUSER', 'website');
$area_id = $objRightsAdminPerm->addArea($app_id, 'ONLY_AREA', 'the one and only area');

// Then he adds three rights
$right_1 = $objRightsAdminPerm->addright($area_id, 'MODIFYNEWS', 'read something');
$right_2 = $objRightsAdminPerm->addright($area_id, 'EDITNEWS', 'write something');

echo 'Created two rights with id ' . $right_1 . ' and ' . $right_2 . "\n";

// Grant the user rights
$objRightsAdminPerm->grantUserRight($user_auth_id, $right_1);
$objRightsAdminPerm->grantUserRight($user_auth_id, $right_2);
?>

I just copied it from the PEAR/LiveUser manual. I just learn how it works... but it looks like it doesn't work...