vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Require user login to access custom PHP application (https://vborg.vbsupport.ru/showthread.php?t=33127)

certify 12-11-2001 04:31 PM

I have a custom application and I want to use vbull login user system. If they are not a member they can't access the resource. How do I do it?

certify 12-12-2001 09:31 AM

Please anyone??

Lesane 12-12-2001 10:05 AM

I dont know if this is what you are searching for. I did this with my chat. When someone is not registered they receive the template: error_nopermission_loggedout if they are a member they will c the template chat:

PHP Code:

<?
require("global.php");

if ($bbuserid == 0)
{  
eval("dooutput(\"".gettemplate("error_nopermission_loggedout")."\");");
   exit;
}

if ($bbusername == "" || (isset($bbusername))==0)
{
  $getusername=$DB_site->query_first("SELECT username FROM user WHERE userid=$bbuserid");
  $username=$getusername[username];
  $bbusername = $username;
}
else
{
   $username = $bbusername;
}

   eval("dooutput(\"".gettemplate("chat")."\");");

?>


Lesane 12-12-2001 12:03 PM

or an shorter way: :)

PHP Code:

<?php

  
include("global.php");
  if (!
$bbuserinfo[userid]) {
      eval(
"dooutput(\"".gettemplate("error_nopermission_loggedout")."\");");
  } else {
  eval(
"dooutput(\"".gettemplate("chat")."\");");
    }

?>


certify 12-13-2001 09:12 AM

Thanks, you are my saviour. :)

certify 12-13-2001 11:37 AM

I manage to get this working but how do I forward it back fater login from the nopermission page back to 1.php instead it goes back to usercp.php

http://www.certifyexpress.com/exam/bea/1.php

Lesane 12-13-2001 12:27 PM

Then you have 2 copy the content of the error_nopermission_loggedout template, make a new template and change this value:


<input type="hidden" name="url" value="/forum/usercp.php">


And also define in the script your new template name instead of error_nopermission_loggedout ;)

certify 12-13-2001 04:56 PM

I'm a little confuse.

Could you give me a sample template?

Lesane 12-13-2001 08:10 PM

You have 2 make a new template. Put in the new template the same code as you have on the template: error_nopermission_loggedout

Now go 2 your new template and look for this line:

<input type="hidden" name="url" value="$scriptpath">

And change that to:

<input type="hidden" name="url" value="1.php">

Now link in your script to your new template name with the modification instead of referring to error_nopermission_loggedout.

Its not tested but it should work :)

certify 12-17-2001 01:09 PM

Thanks Lesane! I got it working now.


All times are GMT. The time now is 09:20 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01160 seconds
  • Memory Usage 1,729KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete