Please help how to I do php file for call username login or session user login(table_online) for ext

Discussion in 'General Chat' started by bangkok4u, Oct 24, 2016.

  1. bangkok4u

    bangkok4u New Member

    Please help how to I do php session file for call username login or session user login for external script (Album , Chat , Forum)

    Thank you from user in Thailand
  2. Dayir_A.

    Dayir_A. Staff Member

    Hello @bangkok4u,

    Sorry but can you clarify your question? Do you need a username of logged in user? If yes, then you can get the info of currently logged in user by calling method
    Code (Text):

    $loggedInUser = iaUsers::getIdentity();
     
    if you pass a parameter 'true', it will return the array, otherwise object will be returned.

    Thanks.
    Andrew_G. and bangkok4u like this.
  3. bangkok4u

    bangkok4u New Member

    Thank you so much I can do it

    [​IMG]
  4. Dayir_A.

    Dayir_A. Staff Member

  5. bangkok4u

    bangkok4u New Member

    Ask for help again I can not run a session outside the Folder root Subrion CMS

    Exam /public_html/cms/front/< session in folder run work then
    /public_html/< session not show my code echo $_SESSION['cmuser'];

    Try this, it's not. http://www.subrion.org/forums/threads/500-error-after-i-moved-to-new-folder.2279/
    //session_save_path('/home/domains/public_html/cms/tmp');
    session_save_path('/home/domains/public_html');

    Thank you ^^
  6. Janur_J.

    Janur_J. Staff Member

    FYI the script manages to set custom session name. That is why you see different data for session that runs under default/different session name.

    With this regard, in order to obtain the Subrion's session data, you need to run your session with the same name as Subrion script does. It may become kind of tricky as this name would be unique for every installation.

    Further, I may only refer you to the code. Nothing special there, you just need to do some manipulations with the strings.

    index.php in the root directory of the script. Find the following code:

    Code (Text):

    session_name('INTELLI_' . substr(...));
    session_start();
     
    Just set the same session name in your script. This would make it possible to access Subrion's session data.

    Hope it helps.
    Andrew_G. and Dayir_A. like this.

Share This Page