The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/printthread.php 16 require_once
Warning [2] Undefined property: MyLanguage::$archive_pages - Line: 2 - File: printthread.php(287) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/printthread.php(287) : eval()'d code 2 errorHandler->error
/printthread.php 287 eval
/printthread.php 117 printthread_multipage



UserSpice
handle existing join+login page - Printable Version

+- UserSpice (https://userspice.com/forums)
+-- Forum: General (https://userspice.com/forums/forumdisplay.php?fid=20)
+--- Forum: New to UserSpice? (https://userspice.com/forums/forumdisplay.php?fid=22)
+--- Thread: handle existing join+login page (/showthread.php?tid=418)

Pages: 1 2


handle existing join+login page - yuma - 01-04-2017

Hi mudmin,

how do i replace an existing user management script that handles a page which already has its graphic design, that has both JOIN and LOGIN forms on it, with UserSpice?


yuma


handle existing join+login page - mudmin - 01-04-2017

The simplest thing to me would be to just use our login/join logic. In other words, you don't need to use our actual login.php form, but if you use your own form,just have it use the php that we use to do the actual logging in. Then each page just needs the init file and the securePage function.


handle existing join+login page - meetmec12 - 01-08-2017

Cool !I hope this is what I think it is. A custom register and login page? If yes how do we handle the google and Facebook login feature on d custom form .


handle existing join+login page - mudmin - 01-08-2017

Dealing with google/fb might be the easiest part of it because we do those with their own includes. So let's take a look.

Let's say you have

mydomain.com
mydomain.com/youroldfiles
mydomain.com/users (The bulk of the userspice files)

Let's say you have your login page (just for reference at)
mydomain.com/youroldfiles/yourlogin.php

If you open OUR login.php file and go to lines 117-124, you'll see that just above our actual login form, we have

Code:
<?php
Code:
if($settings->glogin==1 && !$user->isLoggedIn()){
Code:
require_once $abs_us_root.$us_url_root.'users/includes/google_oauth_login.php';
Code:
}
Code:
if($settings->fblogin==1 && !$user->isLoggedIn()){
Code:
require_once $abs_us_root.$us_url_root.'users/includes/facebook_oauth.php';
Code:
}
Code:
?>

That is all of our fb/google logic being included. So you could put that on your own login form in one of two ways...
1. Change the require once statements to "back out" of your folder and go over to the UserSpice folder.
Code:
require_once '../users/includes/google_oauth_login.php';

2. Put in the full url
Code:
require_once 'http://mydomain.com/users/includes/google_oauth_login.php';

I hope that helps.



handle existing join+login page - meetmec12 - 01-10-2017

Working well! I tried to take it to the next level . I used ajax tabs for login ,register and forgot password. I hope to achieve page navigation without reloading . (I hope this is added in US5) it all worked well until when user type wrong password ,email etc. I get redirected to the main join.php and login.php


handle existing join+login page - mudmin - 01-11-2017

I'm terrible at Ajax so I'm probably not much help.


handle existing join+login page - JUG - 03-13-2017

What if I want to combine login.php with join.php?

I copied join.php logic to login.php and added _join.php view to the login.php. Next I changed $form_action ='join.php' to $form_action = 'login.php', so when I click register button I'm not sended away to join.php anymore.

Now here I'm stuck with some problems. If I now try to login OR register, I get Token doesn\'t match! message, after I click on login or register button.

I have tried to delete this line '<input type="hidden" value="<?=Token::generate();?>" name="csrf">' from login.php AND/OR from _join.php. I have tryed to rename tokens (from name="csrf" to name="csrf2") with no success. I have tried to comment out previous line of code and commented out the php logic that throws this error. But either way, the forms aren't working, or is only working one of them (either register or login).

@mudmin: can I somehow send you an PM?


handle existing join+login page - mudmin - 03-13-2017

Sure. I sent you an email asking you to pastebin your attempt at it and I will take a look.


handle existing join+login page - JUG - 03-14-2017

Pastebin for login.php and _join.php

Site is online at oblak.ersim.si

Thanks!


handle existing join+login page - mudmin - 03-14-2017

I'm making some progress on this, but I'm going to be gone for the day, so it will be a bit till I can get back to you.