Menu
 News
 Search
 Topics
 Stories Archive
 Submit News
 Discussions
 Code of Conduct
 Forums
 Forum Search
 Last 24 Hours
 PO 24hrs
 Peak Blog
 Ask Jane
 Resources
 About Us
 Downloads
 Web Links
 PeakWiki
 PeakPortal
 Focus Search
 Peak TV
 Peak Oil Boston
 Houston Peak Oil
 Follow on Twitter
 Members
 User Panel
 Members List
 PO Team
 JOIN!
 Private Messages
 
Support PeakOil.com
Visit Our Advertisers
 
Light Sweet Crude Oil
 

Net App Training
Aaron





Post new topic Reply to topic  [ 17 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: some of the forums won't open
New postPosted: Sun Sep 20, 2009 9:28 pm 
Offline
Intermediate Crude
Intermediate Crude
User avatar

Joined: Thu Mar 27, 2008 12:00 am
Posts: 734
Location: Las Vegas
Jotapay wrote:
admin wrote:
Is anyone still having problems?
:?: :?: :?:


Yes. I still have no permissions to see the forums.

In the PHP scripts, set your ID or permissions to me and you will see the problem. On the permissions include on every page, create a line like this. This is formatted for generic C#/JavaScript/Java/JSP syntax, but your syntax will be similar and you just have to figure out your script notation.

if (usr == 'admin')
{
usr = 'jotapay';
}

'usr' would be your type variable (a string, since this is a script and not managed code where strings are objects) for the user logged in, so you can view a page with my permissions. If you actually have a user class or object (where 'usr' is an object and 'name' is a property of object), then you need to do something like this, where the parameter for the constructor is the string of the user id.

User usr;
.....
if (usr.name == 'admin') // a Java/JSP variant is: if (usr.name.equalsIgnoreCase('admin'))
{
usr = new User ('jotapay');
}


Do a bunch of script dumps to the Apache (or IIS) log as the code executes in sequence, or email them to yourself, so you can see what it going on. Scripts are a pain, as you are experiencing. Managed code with a deugger (like ASP.NET) is so much more preferable in my experience.



Boy I am so far behind the 8 ball when it comes to computer jargon, this post above looks like Chinese to me..


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Re: some of the forums won't open
New postPosted: Mon Sep 21, 2009 5:22 am 
Offline
Moderator
Moderator
User avatar

Joined: Mon Jul 19, 2004 12:00 am
Posts: 1754
Location: Singapore
timmac wrote:
Boy I am so far behind the 8 ball when it comes to computer jargon, this post above looks like Chinese to me..


Happily, I can read both PHP and Chinese :lol:

An easier way, instead of modifying the code and risk messing up the system, would be to reset the password of a user who is having these problems, share the accounts for a while, so that the admin can login and try to reproduce the problem and fix it. Of course we could also create another test account and see whether that is having the same problem.

But yeah, I agree that debugging scripting-type languages without a proper debugger can be quite a pain. We're reduced to println("---> x = " + x + " <---") kind of stuff just to see what the heck is going on.

_________________
Live quotes - oil/gold/silver


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 17 posts ]  Go to page Previous  1, 2


Who is online

Users browsing this forum: No registered users and 2 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Atom News Feed   Forums RSS Feed