loshMiS

loshMiS supports this item

Supported

This author's response time can be up to 1 business day.

660 comments found.

https://socialiteproviders.github.io

I realize that you might not be able to help with this. What would be the best way to add these additional packages to the default socialite providers? I am not an expert at larvel, so a point in the right direction would be appreciated m

Hey,

Well you would just install the provider you want via composer and follow the instructions on how you should integrate it in to the app by setting the configuration parameters and environment variables.

Once you set that up, then you can check the Vanguard documentation on adding new social auth provider (https://docs.vanguardapp.io/adding-social-auth-provider.html) which basically just comes down to upgrading the configuration file and adding some HTML to the login page. :)

Regards,

Milos

boetti

boetti Purchased

Hi Milos!

I need some help! I´ve made a custom blade and custom controller for a frontend-page and i need to check if user has role admin or not to show some special content!

e.g. if someone is on the page it shows Button A if admin (after login) is on the page it shows Button B.

I put “use Auth;” and “use Vanguard\User;” in the controller but @if (Auth::user()->hasRole(‘Admin’)): don´t work.

if i put “Middleware(‘auth’)” to the controller the page doesn´t show up for non registered users…

Thanks

Hey,

Well what you include inside the controller has nothing to do with you view (since the code you provided above is blade template and it should go in your view).

If you put the ‘auth’ middleware in a controller, it actually should not allow unauthenticated users to access the page. That’s how middleware work.

So, inside your blade file, you will have something like:

@if (Auth::user()->hasRole('Admin'))
// some html here
@endif

But remember, this will only work if user is already logged in. If you want to allow access to this page for non-authenticated users then you should also check if user is authenticated inside your view by using Auth::check().

Regards,

Milos

boetti

boetti Purchased

Thank you for your inspiration!

I managed it with the following: @if (Auth::check()) @if (Auth::user()->hasRole(‘Admin’)) Admin @else No Admin @endif @else Not logged in @endif

Oscar165

Oscar165 Purchased

Leaving the login screen up, it timeouts I enter the login info and it tells me the token mismatch. Can you just refresh the token and return back to a blank login page. If I click back I still don’t get an updated token, the page has to be refreshed. I would rather the user have a blank login with a refreshed token. Or maybe I’ll add a message to refresh after 30 minutes.

Hey,

I’m sorry but your support for this item has expired. Please extend it if you have some questions.

Regards,

Milos

Oscar165

Oscar165 Purchased

I believe this is an issue with anyone purchasing this package. It really degrades a clients experience.

oceanura

oceanura Purchased

Hello I followed your documentation to install at root level of domain.

Problem I’m having is app is only accessible when going to domain.com/index.php but not domain.com, returns “Not Found The requested URL /login was not found on this server. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.”

Hey,

I’m here to help! :) Ok, from what you wrote above it looks like your Apache web server is not configured properly and it looks like apache mod_rewrite is not installed and enabled. Please make sure that apache mod_rewrite is installed and enabled since it is required so Laravel routing system can work properly. Also, check the FAQ section inside the documentation since it already contains explanation for this issue (second question from the top): https://docs.vanguardapp.io/faq.html

Regards,

Milos

Hi,

How i can manage the sessions, if i have active session in one computer and i try yo login in other the system know that?.

Regards

Hey,

If you decide to use database session driver (which is the default driver when Vanguard is installed) then you are able to see the number of active sessions for specific user and you are able to implement the session limit and allow users to be logged in on one device at the time (to have one active session only).

That does not come out of the box in Vanguard, but you can easily implement it by modifying the login procedure and checking the number of active sessions for specific user. The login related code is located inside app/Http/Controllers/Web/Auth/AuthController.php file, and if you are familiar with Laravel you should be able to easily customize the login behavior.

Regards,

Milos

Hey IoshMiS,

i have tried to install the Advanced PHP Login and User Management System but the last step ends with this error:

[2017-10-04 09:00:31] production.ERROR: copy(/var/www/html/.env.example): failed to open stream: No such file or directory Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, ‘copy(/var/www/h…’, ’/var/www/html/a…’, 84, Array) #1 /var/www/html/app/Http/Controllers/Web/InstallController.php(84): copy(’/var/www/html/....’, ’/var/www/html/....’) #2 [internal function]: Vanguard\Http\Controllers\Web\InstallController->install() #3 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(55): call_user_func_array(Array, Array) #4 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(44): Illuminate\Routing\Controller->callAction(‘install’, Array) #5 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Route.php(203): Illuminate\Routing\ControllerDispatcher->dispatch(Object(Illuminate\Routing\Route), Object(Vanguard\Http\Controllers\Web\InstallController), ‘install’) #6 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Route.php(160): Illuminate\Routing\Route->runController() #7 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(572): Illuminate\Routing\Route->run() #8 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(30): Illuminate\Routing\Router->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request)) #9 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(41): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request)) #10 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(148): Illuminate\Routing\Middleware\SubstituteBindings->handle(Object(Illuminate\Http\Request), Object(Closure)) #11 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request)) #12 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(65): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request)) #13 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(148): Illuminate\Foundation\Http\Middleware\VerifyCsrfToken->handle(Object(Illuminate\Http\Request), Object(Closure)) #14 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request)) #15 /var/www/html/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request)) #16 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(148): Illuminate\View\Middleware\ShareErrorsFromSession->handle(Object(Illuminate\Http\Request), Object(Closure)) #17 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request)) #18 /var/www/html/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(64): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request)) #19 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(148): Illuminate\Session\Middleware\StartSession->handle(Object(Illuminate\Http\Request), Object(Closure)) #20 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request)) #21 /var/www/html/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request)) #22 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(148): Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse->handle(Object(Illuminate\Http\Request), Object(Closure)) #23 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request)) #24 /var/www/html/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(59): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request)) #25 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(148): Illuminate\Cookie\Middleware\EncryptCookies->handle(Object(Illuminate\Http\Request), Object(Closure)) #26 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request)) #27 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(102): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request)) #28 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(574): Illuminate\Pipeline\Pipeline->then(Object(Closure)) #29 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(533): Illuminate\Routing\Router->runRouteWithinStack(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request)) #30 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(511): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request)) #31 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(176): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request)) #32 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(30): Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http\{closure}(Object(Illuminate\Http\Request)) #33 /var/www/html/vendor/proengsoft/laravel-jsvalidation/src/RemoteValidationMiddleware.php(54): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request)) #34 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(148): Proengsoft\JsValidation\RemoteValidationMiddleware->handle(Object(Illuminate\Http\Request), Object(Closure)) #35 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request)) #36 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php(46): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request)) #37 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(148): Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode->handle(Object(Illuminate\Http\Request), Object(Closure)) #38 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request)) #39 /var/www/html/app/Http/Middleware/VerifyInstallation.php(29): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request)) #40 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(148): Vanguard\Http\Middleware\VerifyInstallation->handle(Object(Illuminate\Http\Request), Object(Closure)) #41 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request)) #42 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(102): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request)) #43 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(151): Illuminate\Pipeline\Pipeline->then(Object(Closure)) #44 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(116): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request)) #45 /var/www/html/public/index.php(53): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request)) #46 {main}

Do you have any idea what the problem is? Folders have the right permissions and all other steps was green.

Greetings, Chris

Hey Chris,

Yup, the problem is that you forgot to upload .env.example file to the server. The file is available inside the zip file you downloaded from CodeCanyon and it is located in Vanguard’s root folder. So, just make sure that you upload the file and start the installation again. :)

Regards,

Milos

Hey Milos,

thank you very much! I did not see the file on my mac folder so i did not notice its there. Maybe you can change the name to edit.env.example and add it to the instructions to change the filename after the upload.

Do you offer custom changes on the system? If so what are the prices for it?

Greetings, Chris

Hey Chris,

I’ll consider changing the name of that file for some future releases. :)

Unfortunately I’m really busy at the moment working on some other projects I have and I’m not available for any custom changes.

Regards,

Milos

Hey loshMiS,

i am sorry but i have another problem. I try to use the smtp settings as you described but it looks like the mails do not get send. The system tells that the mail is send and the error log is also empty but i get no mails in my inbox or spam folder.

I already contacted the hoster and they told me that from the server ip i try to send the mails from no requests come in.

First i opened all needed ports but no mails came in so i disabled ufw firewall to get sure all ports are open.

The login details are checked many times and there is no problem.

Is there a way i can check where the mail sending stops? And are you totally sure there is no problem?

Greetings, Christian

No i did not touch any setting its a fresh system right now and still configure it. The VPS hoster replied and told me that all ports already opened for smtp :/

omg ;/ i am sorry!!! I defined the MAIL_FROM_ADDRESS and the MAIL_FROM_ADDRESS twice in the .env file. So after deleting yours and change tls to ssl all mails are working!

Hey,

No problem, I’m glad that it’s working for you now. :)

Regards,

Milos

Hi Milos,

I need to know if this script don’t logout when the IP is changing every minute or something like that, because with advanced security (your other script) even when I change to false the fingerprint always the sessions is closed… so my question is, with this script maybe that don’t happen, and I will buying and I think that I will need to change the entire code…because I think even the language in this script is different.

Best Regards

Joaquin

Hey Joaquin,

Nope, Vanguard won’t log you out if you IP changes every minute or so. However, Vanguard is written on top of Laravel PHP framework and it is much more complex than AS script, so in order to customize it you need to be familiar with Laravel.

Regards,

Milos

mmm ok… yes I am not familiar to Laravel… There is any change in future that you can update this option in AS script? or definitely need to change to this framework?

Hey,

Well it’s just a matter of actually removing that protection from AS, since it is already there. If you are using the latest version of AS, then setting LOGIN_FINGERPRINT to false should be more than enough for sure. If it still doesn’t work after you set this configuration parameter to false then it is probably some issue with server configuration.

Regards,

Milos

hygewv

hygewv Purchased

Hello!

I found bug. Go to admin panel like client. Then go to log sessions. Then try to search something like: profile/activity?search=123 then you will see red cross. So if you press on this red cross – then you will see Forbidden!.

Hey,

Thanks for pointing out this glitch. I’ve fixed it and it will be uploaded in next Vanguard release. Until then, if you want to fix it yourself, just go to resources/views/activity/index.blade.php and replace
<a href="{{ route('activity.index') }}" class="btn btn-danger" type="button">...</a>
with
<a href="{{ isset($adminView) ? route('activity.index') : route('profile.activity') }}" class="btn btn-danger" type="button">...</a>

About the documentation, it clearly says inside the Introduction that we are adding two fields, Country and Nick Name, and that’s why I explain how to extend AuthController with country related data. If you don’t want to add country field to registration form, then, of course, you will skip parts related to countries…

Regards,

Milos

hygewv

hygewv Purchased

Thanks, I added nickname. But there is no information how to add nickname field for editing for admin and for editing for user. How to make also ability to edit this field by admin and users?

Hey,

Well there is no info about that because the procedure is almost the same. If you understand all the steps you have done to add the Nick field to registration form and you are familiar with Laravel, then adding new form field anywhere across the app should not be an issue for you. So, in your case, you will need to update view files related to user profile page and edit user page and to update appropriate controllers to actually save that new field into the db.

Regards,

Milos

Hey again,

i tried to find where the login, registration and password reset page get the Copyright © footer from i cant find the file :/

Could you tell me where its located please?

Greetings, Chris

Hey Chris,

All those pages use the same layout which is defined inside resources/views/layouts/auth.blade.php, and that’s where you can customize the Copyright part.

About emails, the template that is being used is located inside resources/views/vendor/notifications/email.blade.php file, and that’s where you can customize logo and colors for each email notification that is being sent from the app.

Regards,

Milos

Hey Milos i am sorry but i cant find any related to copyright on that page.

@yield(‘content’)

I think it gets included here? in the content yield?

My fail i found it :) ty

Hey Milos,

i come closer to understand the system and how it works and i already got pages up and running with new permissions and stuff but now i stuck at the next problem. I try to load data from database to a controller and i do not understand the example you provide. I know its not really related to the support but maybe you are open to share this with me :) This is what i try but it does not work also not without the where in the query. So my question would be: how can i query that database table i created and take the active logged users email in the query. The page controller has need auth included so the data should be there to grab or? Thank you very much! This is how i tried it in the controller:

public function index()
{
    $stats = DB::select('select * from hashes where mail=AKTIVEUSERMAIL');
    return view('stats.user-stats', compact('stats')); 
}

Okay i get the data with adding

use Illuminate\Support\Facades\DB;

And call it with

$stats = DB::table(‘hashes’)>where(‘mail’, ‘AFIXEDMAIL’)>get();

So i just need to know how i can replace AFIXEDMAIL with the current logged in user mail and it would be working. Would be cool if you could tell me how to get the mail of logged user on the controller.

Okay solved is that save?

<?php

namespace Vanguard\Http\Controllers\Web;

use Illuminate\Support\Facades\DB; use Vanguard\Http\Controllers\Controller;

class UserStatsController extends Controller { }

protected $userMail;
public function __construct()
{
    // Allow access to authenticated users only.
    $this->middleware('auth');
}
// Allow access to users with 'users.manage' permission.
$this->middleware('permission:user.stats');
public function index()
{   
    $userMail = auth()>user()>email;
    $stats = DB::table('hashes')>where('mail', $userMail)>get();
    return view('stats.user-stats', compact('stats')); 
}

Hey,

Yup, that’s the way to access the currently logged in user and his email. :) You don’t need protected $userMail; though since it doesn’t make any impact on functionality.

Regards,

Milos

Is it possible to move users from your ‘Advanced Security – PHP Register/Login System’ to Vanguard without resetting everyones passwords? How is it best to transition?

Hey,

Unfortunately you cannot do that easily because of different password hashing algorithm. The easiest way to do it is by writing a script that will read from one database and add values to another and then, once all users are moved, you can send them an email that system is being upgraded and that they need to reset their password by using forgot password feature.

Regards,

Milos

OK, I thought this might be the case. Thanks for confirming.

I have a problem on iphone Safari/Chrome. With Macbook, Safari/Chrome doesn’t have problem. However, iPhone/iPad Safari/Chrome loses its connection very often. Sometimes, iphone tries to connect server, and some time just CSRF token error. I’m beginner. Can you guide me at which point I can start the debugging?

Hey,

I don’t see that you have purchased the application. Can you please post a comment from an account which you used to purchase the product?

About the issue you have, that’s probably because it keeps the page open and when you come back to it after a while and try to submit the form without actually refreshing the page you get CSRF error. This is because session cookie has expired in the meantime. What you can do is to simply extend the session cookie lifetime inside session configuration file.

Regards,

Milos

Hello IoshMis I am ming I want to know one thing. I tried to implement Google 2FA authentication. I read your documentation thoroughly , but i can not understand how to do for that. In dashboard page, it says “In order to enable Two-Factor Authentication you have to register and create new application on Authy Website, and update your AUTHY_KEY environment variable inside .env file.”

So I think if i download Auth key, then it is very helpful for me.

I tried to get key using Google developer account, but not good. Could you tell me about this in detail?

My email is likemingming777@hotmail.com and skype is mingxiao2008

If you send me screenshot files and some comment, then it is good solution for this .

Thank you advance.

Ming

Hey Ming,

Well Vanguard is not using Google 2FA. It’s using Authy ( https://authy.com/ ) and that’s why it says inside the documentation that you need to create Authy account, grab your key from there and update .env file like it is described inside the docs.

Regards,

Milos

p0150n

p0150n Purchased

Hey IoshMiS, thanks for your great project love it. but why twillio Authy (payed) instead of google 2fa, is more populare and for free or both would be rocket. Can you make it possible ? or guide me how to enable google 2fa. thanks in advance,

keep this project up

Regards

Hey,

Google 2FA is not available out of the box and you will need to implement it yourself. Unfortunately I’m not able to guide you through that process, but I’ll consider adding Google 2FA in some future updates. :)

Regards,

Milos

p0150n

p0150n Purchased

Maybe after reading not

Hey Milos,

i would need a quick help again. I try to access a image from public/assets/img folder with this code as you did in main template but it looks like my images are not reachable and end with a not allowed:

src=”{{ url(‘assets/img/coins/CLAM.png’) }}”

Greetings, Chris

figured it out. Files did not have right permissions after the upload.

hi i need some help

once user logs in i need them redirected to the previous page . i did all the necessary configuration but it takes user back to the dashboard instead of the home page africanunion.com . here is the code i used <?php require_once DIR . ’/../vanguard/extra/auth.php’; //Move this to some helper function if you need it more than once $currentUrl = (empty($_SERVER[“HTTPS”]) ? “http://” : “https://”) . $_SERVER[“HTTP_HOST”] . $_SERVER[“REQUEST_URI”];

if (! Auth::check()) {
    redirectTo('/../../public/index.php?to=' . $currentUrl);
}

Hey,

The code you describe should redirect user to “login.php” file, not to “index.php”. So, the redirect line should look like

redirectTo('/../../public/login?to=' . $currentUrl);

Also, you should not use “index.php” as part of URL since it will prevent images from loading properly. From what I can see, your apache rewrite is working properly so you can just omit it from your urls.

Regards,

Milos

hi, does this have the ability to email users so we can verify their email address?

Hey,

Of course, there are 12 different database tables used by Vanguard.

Regards,

Milos

Hi, is it possible for me to have a list of the tables and their role so I can see whether i’ll be able to merge it into our existing system?

Hey,

Here is the list of tables, and it’s pretty clear what each of them is used for

api_tokens
countries
migrations
password_resets
permission_role
permissions
roles
sessions
settings
social_logins
user_activity
users

Regards,

Milos

Hi, pre sales question. Could this work for the following application: We run courses. We’d like to have our clients to be able to access our courses online via an app. Given the fact we have many different lessons, could we assign specific lessons to individual users ?

Hey,

Well you can use Vanguard as a starting point for such app, but it wont work out of the box and you will actually need to add courses and lessons into the system and implement interface where you will assign lessons to individual users.

Regards,

Milos

by
by
by
by
by
by