vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Hook before login authetification or redirect to login again (https://vborg.vbsupport.ru/showthread.php?t=283789)

Bundschuh 06-01-2012 08:10 AM

Hook before login authetification or redirect to login again
 
Hello,

my purpose is to extend the login process to check another database if a user doesn't yet exists in vb db. If the given username matches on the other database then a new vb user will be created. This works fine using datamanager etc.
The user should then be automatically logged in but that doesn't work. A new user will created but not logged in. Instead he will be redirected to login page again.

I tried hook location "login_failure", but looking in the code I saw that it can't work. The hook is called after function verify_authentication, which will of course return false if a user doesn't exists yet.

Is there a hook I can use which is called before? Maybe I have overseen something.

If not a possible solution would be to redirect to login again using same post data. How can I realize this? Does vB API provide some function for this?

Thanks in advance. I'd really appreciate.
Greetings
Bundschuh
The hook is directly called after user

kh99 06-01-2012 12:26 PM

You might be able to do something like use hook global_bootstrap_complete, and check for THIS_SCRIPT == 'login' and $_POST['do'] == 'login', if you can find a way to do what you need to do *before* the vb code checks it's login info.

Otherwise, you can always make file edits if you have to. Of course it's not nearly as nice as using plugins, but if it comes down to it it might be better than not having your mod.

Bundschuh 06-01-2012 03:31 PM

Thanks kh99,

that made my day. It's not 'global_bootstrap_complete' but rather 'global_bootstrap_init_complete' where the basic vB things are initialized.

This should replace a hook like 'login_init' or sth else.

Greetings
Bundschuh

Bundschuh 06-04-2012 07:08 AM

Just a little correction to the hook 'global_bootstrap_complete'.
Actually it is called after '*_init_complete' but the variable $vbulletin is only accessable when calling
Code:

global $vbulletin;
Greetings
Bundschuh


All times are GMT. The time now is 11:44 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.00980 seconds
  • Memory Usage 1,711KB
  • 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
  • (1)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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