What does the loggedin column of vBulletins session table mean? - session

In vBulletin 4.2 the session table has a column loggedin. Since VB doesn't seem to have a official database documentation, I want to know what exactly it means because the column it's a SMALLINT instead of simple boolean value.
My previous reverse engineering: 0 means not logged in. 1 and 2 is used for logged in users, but I can't see what's the difference. I have both regular user session and admin panel sessions with loggedin=2.
Tried to get more information by running grep on vBulletins php files, without luck .
So my concrete questions are:
What is the difference between sessions with 1 and 2?
Are there more states than 0, 1 and 2?
Do they even matter when vBulletin's code doesn't seem to use them?

I learned that my filter to *.php files broke greps recursive scanning method. The correct command to scan all php files for 'loggedin' (in quotes since vB use them this way on it's $vbulletin->session object) is:
grep -rn --include \*.php "'loggedin'" .
This gave a few results. Most interesting:
./includes/functions.php:7558: $vbulletin->session->set('loggedin', 2);
Opening functions.php we see the call and we can feel lucky that at least in the code vB developers to decide that a comment would be usefull:
if ($vbulletin->session->vars['loggedin'] == 1 AND !$vbulletin->session->created)
{
# If loggedin = 1, this is out first page view after a login so change value to 2 to signify we are past the first page view
# We do a DST update check if loggedin = 1
$vbulletin->session->set('loggedin', 2);
// ...
}
So we can say that 1/2 doesn't gave information about the type of session. It could be a regular user or also admin session. Altough loggedin indicates if the user already viewed some other pages or not, whyever vB devs need to devide this.

Related

OBIEE 12C: use of presentation variables

I have a question concerning the use of presentation variables:
1) What's the correct syntax for filtering on a presentation variable is used? You allow a user to select multiple values in a filter eg. A and B. If you use the syntax = '#{PV}{%}' it will result in this sql: = 'A, B' which of course won't exist in the data. I'd like to have this result: in ('A', 'B').
I've already found this syntax: (#{PV}['#']) which gives the correct sql, only thing here is that this doesn't work when you have a dashboard prompt where you allow 'all column values'. When no value is passed to this presentation variable, the analysis throws an error. I have no idea how to put a default value in this one. Any ideas on this?
2) Is there any configuration or setting where you can push obi to use a presentation variable in stead of using the 'normal' way of filtering as shown here:
The obi way is that it changes the relation to the relation in the prompt (if the prompt says 'is greater than' it will change here as well, even though you've put here 'is equal to'), but it will also use a value for this dimension if there's ever been a value for this, rather than listening to the value in the presentation variable of the dashboard prompt. I know that you can translate this to SQL but that's not the way to go for me. The behaviour I'd like is (in this exact order):
- when there is a value in the presentation variable in the dashboard prompt, take this.
- when there is a value for this role of the dimension, take that.
The reason why is because we have this dimension 'Afdeling' which can take up many roles but our customer asked for the roles to be hidden from the end user. This means that even though you switch roles, the end user always sees 'Afdeling' and couldn't care less in which role it is looking at its 'Afdeling'. They can switch between different dashboard pages and if I'd put on top of the page the dashboardprompt of the 'Afdeling' in the role it needed to be, the value won't pass through when switching pages to another dashboardprompt of another role. That way the end user would know something was up. So the value needs to pass through the prompt on each page, no matter what the role of that dimension.
After a bit of googling I've found the answer to question 1 myself. Thanks to this website https://www.obieetips.com/2014/05/obiee-11g-using-multiple-value-for.html I now know that the correct syntax is (#{pv_region}['#']{'West '})

OBIEE Passing Parameter to Analysis With URL

I have this Analysis that I wish to invoke from URL (which I can).
This analysis in particular is mounted on a dashboard and 6 of the 17 columns can be filtered from a prompt mounted on the same dashboard.
I only need the analysis and still be able to filter the results. I read about parameters that can be given to the URL, but I can't seem to make the filters work. I am using the &P0=n parameter and the consequent &P1=xx parameter.
Without the &P I am able to see the table, when I add parameters I get this error UH6MBRBC:E6MUPJPH.
Thanks for your time, have a nice day.
Got it to work by myself afterall (always best).
Basically instead of &p0 and such I used &coln and &valn (where n is the column number):
&coln - is the name of the field
&valn - is the value for which you filter
More information and better explanation can be found here.

google search appliance accurate result count parameter not making a difference

We are having a result count issue where the pages have 10 results per page. For pagination we are getting 64 result count on page 1 (ie start=0), 25 for page 2, and 21 for page 3.
I understand as per documentation for estimated vs actual results that it is not guaranteed but the above result count is when I set filter=0 and rc=1. The rc=1 does not appear to make a difference when included or not. We are on version 7.2.0.G.252
filter=0&rc=1 should work for you and you should see the same count even after paginating.
What you need to notice is, when you click on pagination link, make sure the filter=0&rc=1 are carried over. i.e., after pagination, see if you still have the filter and rc parameters intact.
Also check using the default_frontend as your custom frontend may not be handling it?
The problem was related to the collection not the query. The content match pattern did not include a "/" at end which when resolved gave an accurate count. Thanks for the assistance.

Character length in single line edit filter PowerBuilder

My SQL code gives me over 10 000 rows, each containing client id, name, address and so forth. In my PowerBuilder 10.5 window I've set my DataWindow in which I'm retrieving my SQL code using id as retrieve argument. I have a Single line Edit (sle_id) in which the user can write an id and search by it. What I've figured out is that all of my clients have id's length of 8 characters and starting with either "46XXXXXXXX" or "7052XXXX". So to optimize my retrieve time I want to write a code in the clicked event of my "Start" button that is located in PowerBuilder window that would first check if the id starts with one of does two options: "46..." or "7052...". I assume I'd need to use length of the characters? For example, this is what I'd want...
IF sle_id.text STARTS with 46 or 7052 THEN retrieve
ELSE MessageBox ("INFO", "Your id must have begin with either 32 or 7052")
END IF;
Of course, I need something better then "Starts with". Much oblige for all the help!
there are some string functions in powerbuilder. I think you need this:
If( left(sle_id.text, 2) = "46" or left(sle_id.text, 4) = "7052" ) then
Best Regards
Gábor
I think you're trying to solve the wrong problem. Your database should have an index on client id. If the client id is unique use a unique index.

Add extra database field to blogengine.net

I have added an extra field in the Pages table that I call VirtualPath. This is so that I can have virtual paths to my pages.
In the code I add "VirtualPath" as an extra parameter to the CommandText which means that there will be 14 elements to pick from the database. I duplicate the routine to grep the actual value:
if (!rdr.isDbNull(14))
{
page.VirtualPath = rdr.GetString(14);
}
The problem is that the it never enters the if-statement. When I step the code and I arrive at the !rdr.isDbNull(14)-row and do step-in I see that the DBHelper makes a dispose somehow...
My question is: Is there somewhere else I have to do a change to add an extra parameter like this? Or, does anyone have an idea of what I do wrong. And yes, I have entered values to the VirtualPath-field in the database so it should not be null.
If there are 14 elements to pick from the table, the 14th should be referenced by index 13 (zero-based index).

Resources