September 07, 2010, 08:30:32 am *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Alternative FF download location here !
 
   Home   Help Search Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: SOLVED: Superadministrator check STILL failing !  (Read 7520 times)
zupidupi
Freshman
*
Offline Offline

Posts: 25


« on: February 08, 2008, 11:32:41 pm »

Hiya, I'm having the same problem as a few other posters in this thread. The call $my->usertype simply doesn't return anything. I'm using Joomla 1.0.13 and FF 1.4.7. Any comments would be greatly appreciated.

   Mike
« Last Edit: February 11, 2008, 07:12:17 pm by zupidupi » Logged
boldee
Administrator
Living Legend
*****
Offline Offline

Posts: 1359



« Reply #1 on: February 09, 2008, 01:11:22 am »

try using my->id if you want to to find the super admin, super admin will always have an id of 62
Logged

Nick

Please read the forum rules first!
Please do not use PM for generic questions!
Please visit...
Protean MMO
zupidupi
Freshman
*
Offline Offline

Posts: 25


« Reply #2 on: February 09, 2008, 09:00:53 am »

Thx, boldee, for the tip. I did, and got the answer 0, checked like this (I've done some fiddling around in the code since I didn't get the ff_getPageByName-call to work, either).

I'e done a bit of coding, so I understand well what we're after here, but a php-environment is somewhat new to me (I know perl, though) and this is my first hack under the Joomla-hood. So, any suggestions/answers can be fairly technical!

// declare our variables and set exists to 0
global $my, $exists;
$exists = 0;

//look through the tables to see if mos_tbd_tags is in the Mambo database.

$dataset = mysql_query('SHOW TABLES') ;

while ($row = mysql_fetch_row($dataset)) {
   if ( $row[0] == "jos_tbd_tags" ) {
      $exists = 1;
      break;
   }
}
// if it exists got to page 1

if ($exists == 1) {
//   $this->page = ff_getPageByName('ftb_intro');
   $this->page = 1;
// if it does not exist send the form to the correct page for user type
} else {
   if ($my->usertype == "Super Administrator") {
//      $this->page = ff_getPageByName('ftb_ctable');
   $this->page = 2;
   } else {
//      $this->page = ff_getPageByName('ftb_ntable');
echo "$my->id: ".$my->id;
   $this->page = 3;
   }
}
Logged
zupidupi
Freshman
*
Offline Offline

Posts: 25


« Reply #3 on: February 11, 2008, 06:28:04 pm »

Aw, BS, I did one final test and solved the problem. I had consistently tested under the admin-interface, not in the main window/homepage. Obviously the $my-variable isn't defined in the admin-interface. Silly problem, silly solution. And now I'm a bit wiser.

   Mike
Logged
boldee
Administrator
Living Legend
*****
Offline Offline

Posts: 1359



« Reply #4 on: February 11, 2008, 07:28:52 pm »

Hi Mike
Hehe always the way lol but as long as you learnt somthing while writting the code it was worth while.
Logged

Nick

Please read the forum rules first!
Please do not use PM for generic questions!
Please visit...
Protean MMO
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by SMF © 2001-2006 Lewis Media
| Terms of Use | Privacy | Sitemap |