1144 comments found.
finally bought your software. trying to incorporate it into existing site and found that all function are built to return a json message. I had to hack the code that use respond helper function to do return respond and change the respond function to simply do return $data.
is there a better/smarter way to do this ?
with the above changes, and making sure the login screen we have from before was updated with the ASCsrf token, and write some javascript to do CryptoJS.SHA512 before submitting, i’m at a point where I need to write a batch php script to attempt to convert the existing user list to work with AS. the existing app has password in clear text (sigh) I grab data and create the array with proper structure to send to $rc = app(‘user’)->add($data);
tried with 2 users to start with, they get added into as_users, all is great except the password. I tried to use the php function app(‘hasher’)->hashPassword() but that doesn’t do the same thing as javascript CryptoJS.SHA512
is there a way to fix the password handling from the php batch script ?
to verify I went in and updated the password via the GUI and it works, but with 500 users to convert, that is not a path I want to take.
Hey,
Well, if you needed the classes to return arrays instead of JSON, then there is no other way than manually modifying them.
About passwords, as you can see it is first hashed with sha512 hashing algorithm before it is being sent to the server, so, you need to simulate that exact behavior. This means that you need to hash the password with sha512 first, and then pass it through hashPassword() function. Something like following:
$hashed = hash('sha512', $plainTextPassword);
$password = app('hasher')->hashPassword($hashed);
And now you have the $password variable, which is what you should store in DB.
Regards,
Milos
Thank you ! since I use $rc = app(‘user’)->add($data);
all I needed to do was $hashed = hash(‘sha512’, $plainTextPassword); and use $hashed in the $data array I send the the add function. /P
Hi,
How can we apply your encryption script to hidden field?
For example to prevent the user changing the ID from browser console.
This is for ID of non sensitive data let say comment_ID.
The hidden field value should be encrypt on form and we should be able to decrypt on sever side to get the correct value.
There is an example on user page
<input type="hidden" id="adduser-userId" />
PS I’m using the old version.
Thanks
Hey,
I’m sorry but your support for this item has expired. Please extend it if you need my help.
Regards,
Milos
I will but at the moment there is a problem about the price, I will contact Envato support…
Can you make the Twitter, Facebook and Google login buttons look much Attractive and ambient
Hey,
Once you purchase the script you get the whole source code, which means that you can customize it to look however you want.
Regards,
Milos
Hi there, loving the system! It’s perfect for our needs.
Is it possible to incorporate the login, forgot password, and user registration scripts with our own pages?
I have tried with our own PHP pages and the system doesn’t recognise the input and thought there might be an easier way to do it.
My workaround at the moment is that I have re-styled your existing login page, but I don’t know how this will work going forward.
Thanks again!
Hey,
Of course, you can incorporate it easily with your login, forgot password and user registration form designs. Basically, just make sure that have included all javascript files from original AS design and that your inputs, as well as form tags, have the same IDs that were used inside the default script design.
If you have any issue, always take a look at browser’s console to see what the error is exactly and so you can fix it easily.
Regards,
Milos
Can this be integrated within YII? Basically, use as login for users to redirect to there account?
Hey,
Well, this is not a package that can easily be used in some existing PHP framework. So, even though it is probably possible to integrate it with YII, it is not created to be used like that and, unfortunately, I cannot guarantee that it will work properly.
Regards,
Milos
Milos,
Thanks again for this awesome script.
A quick question, is there a way we can keep a user logged (especially on mobile)?
It seems I have to re-login daily on desktop, and everytime on mobile.
I looked through the configuration parameters to see if there was a variable for this, but couldn’t find one.
Thanks! Jeff
Hey Jeff,
No problem, I’m glad you like it! 
Well, what you can do is to extend the session duration and set it to few days or something like that. Currently, the session will expire whenever you close the browser, and you can change that inside ASSession.php file. Please check the following documentation section for more details: http://docs.as-php.com/working-with-session.html#session-lifetime
Regards,
Milos
OK… is there any reason why on an iOS device (mobile) I need to log in each time regardless of session duration?
Thanks again for your help!
Jeff
Hey Jeff,
It’s probably because when you close the browser app or open another app it acts the same as when you close the browser on the computer, which means that session will expire automatically in such case.
Regards,
Milos
Hi.
I set the mail configuration to encrypt message with TLS, but when I receive the mail it isn’t encrypted. Am I missing something?
This is the conf.
define(‘MAILER’, “mail”); define(‘SMTP_HOST’, “localhost”); define(‘SMTP_PORT’, 25); define(‘SMTP_USERNAME’, ””); define(‘SMTP_PASSWORD’, ””); define(‘SMTP_ENCRYPTION’, “tls”);
Hey,
Well, that’s not how SMTP encryption work. It does not encrypt the message itself, it just uses a secure channel for sending the message from the app to your SMTP server. To learn more about SMTP, please check the following article: https://en.wikipedia.org/wiki/Simple_Mail_Transfer_Protocol
Regards,
Milos
Hi there, loving your script but am having trouble with the UPDATE PDO.
I currently have:$db->update(
'family',
array ("familyKey" => $key),
"familyId = $familyId",
array("familyId" => $familyId));
I am trying to update a column called familyKey, in a table called family where the familyId = $familyId
Are you able to provide any assistance?
Sorry, and the error I am getting is:
Uncaught exception 'PDOException' with message 'SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens' in [MY PATH]\ASEngine\ASDatabase.php:125 Stack trace: #0 [MY PATH]\ASEngine\ASDatabase.php(125): PDOStatement->execute() #1 [MY PATH]\edit_family_db.php(43): ASDatabase->update('family', Array, 'familyId = 19', Array) #2 {main} thrown in [MY PATH]\ASEngine\ASDatabase.php on line 125
Hey,
Well you get the error because your third parameter is wrong in that function call. It should be "familyId = :familyId". Please check the docs on how to use the update method: http://docs.as-php.com/database-queries.html#update
Regards,
Milos
Hi, Support
1. sidebar.php (<?php if (app(‘current_user’)->is_admin) : ?>) I want to access more than admin role (Role : admin and editor to access). Please a sample code.
2. index.php (<?php if(app(‘current_user’)->role != ‘user’): ?>) I want to protect comment for user and editor role. Please a sample code.
Thank you very much & Happy New Year.
Pom / Bangkok Thailand.
Hey Pom,
As you can read from the docs, whenever you want to get the role for a currently authenticated user, you can do it like following:
app(‘current_user’)->role
Now, when you have that, you can check for that role however you want just by applying simple PHP conditional statements. For example, the answers to your questions above will be:
1) <?php if (app(‘current_user’)->role == 'admin' || app(‘current_user’)->role == 'editor'):
2) <?php if (! (app(‘current_user’)->role == 'user' || app(‘current_user’)->role == 'editor')):
Regards,
Milos
Hi, i have recently installed the script on my website: http://apellidosaurus.com/login/login.php
But when i login it keeps the green box with the message “Logging in” but does nothing more. I have followed the wizard without problem, the ddbb communication is ok because it created the tables and the admin user too.
Thanks.
Hey,
I’ve checked the website and it looks like the problem is with some caching. Can you please disable Cloudflare and try to see if it is working properly then?
Regards,
Milos
I have disabled CloudFlare, and with Safari i can login perfectly, with firefox or chrome i cant. I have cleaned all cache and used incognite mode. With my phone i have loged in pretty well (chrome).
Hey,
Are you 100% sure that you have disabled CloudFlare since I still see CloudFlare related headers inside the response that is being returned from the server when I try to log in?
Regards,
Milos
I have a problem where users aren’t kept logged in. Top of one PHP-page is following(Where logged in user is not retrieved): <?php include ”../Vanguard/ASEngine/AS.php”;
if (! app(‘login’)->isLoggedIn()) {
redirect("login.php");
}
if ( app(‘login’)->isLoggedIn()) { $currentUser = app(‘current_user’); $alias = $currentUser->username;
}
What am I missing?
Hey,
Well, your code looks ok to me. What issues you have exactly?
Regards,
Milos
The user is not logged in. When doing the app-check, user is redirected to login.php.
Hey,
That’s strange… Can you provide the URL to your page so I can see what is happening?
Regards,
Milos
That’s gonna be hard since I cant publish the site before another 2 months maybe
I’l try to solve this somehow. Let me know if you come up with any tricks.
hello dear loshMiS I have some problems, so I need your help. I create and configure google api to login my site. Its ok and I can login by my mail but some of other mail after login come back to login page! So I create a new gmail account and test it, when I use a new gmail account, after login and allow google terms, I redirected to a login page and when I click a login with google+ again, do nothing!! I must to logout by enter logout.php link and try again with google login that fail again! Please tell me whats a problem: http: // uhd . edu .iq / login .php
please check this image about my problem : http://uhd.edu.iq/uhd_err.jpg
thanks , i fix it !!! yaaaaaaaaa ! thanks
Hey , i was facing an error “Invaild CSRF token” once i installed the script. And it turned out that the problem was with CloudFlare DNS cloud service. Which means I’ll have to disable CSRF security. How can i solve this issue with out disabling CSRF
Hey,
Are you sure that it is related to the Cloudflare DNS and not to some sort of caching that Cloudflare provides?
Anyways, I would recommend you to contact Cloudflare support and ask them about the issue. Vanguard is a Laravel application and if you have such issues with it means that there will be issues with any Laravel application. If that’s the case, then they probably have some solution for that and will probably be able to help you.
Regards,
Milos
Hi i can not access my phpMyAdmin page: 1. I have either forgotten the credentials 2. Or i do not remember creating credentials.
How do i gain access to phpMyAdmin page? Regards.
Hey,
I’m sorry but accessing phpMyAdmin has nothing to do with Vanguard. If you have forgotten the password for it, you will need to find some other way to recover it, or maybe look into the .env file for the application to see the credentials that application is using.
Btw, your support for this item has expired. If you have any questions please extend your support.
Regards,
Milos
Hey i have realized that you are right. Sorry. One more thing-I need you to customize the login system for me and of course i will pay for the same. Can it be done?
Hey,
I’m really sorry but I’m not available for any custom work at the moment.
Thanks for asking anyway.
Regards,
Milos
Ok. It would have been great if you had helped me with it. I desperately needed it. Regards, Desai.
Hi, I am troubling accessing ‘User Details’ on my pages. I would like to be able to display the user’s first_name, last_name, etc. I’ve tried this but it does not work:
<?php $info = app(‘user’)->getInfo($userId); echo $info; echo $userID;
?>
This does, but so far I can only access the user_id
<?php $userId= ASSession::get(‘user_id’); ?> <?php $user_id = $userId; echo ”<script type=’text/javascript’>alert(’$user_id’);</script>”; ?>
Also is it possible for me to add my own user id (like an employee id)?
Thanks!
Hey,
Well if you want to access some details for currently authenticated user, then I would recommend you to use app('current_user') for that, like it is described inside the docs: http://docs.as-php.com/current-user.html#user-details
If you want to get details for any user with given Id, then you can do it like following:
$userId = 1; // some user ID that you will fetch from somewhere (it doesn't mean that it is ID of currently logged in user)
$info = app('user')->getInfo($userId);
var_dump($info);
And yes, you can add any other fields you want for your users.
Regards,
Milos
Hi.
I have a small problem with registration.
If I try to register and either username or mailadress already is taken, it prompts that it is taken. But it only works if one of these are taken.
If both mail and username are taken, it just says “Creating account…” and no error is shown.
No big deal for new users, but it might be a helpful remindeer for someone that forget that they created an account and tries to register again.
Hey,
Thank you for letting me know. Do you experience the same behavior on demo website?
If not, can you please send me the URL to your script so I can check and see what can be a problem?
Regards,
Milos
Hi.
Unfortunately I get the same behavior on the demo page(default login page).
Hey,
Hmm… that’s strange. Does it happen when you use english language for the interface or when you use some other language?
Regards,
Milos
It’s behaving very strange. It works for some language and not for others. It’s like 50/50.
The things is, not only is the message not poping up, the button also stays on “creating account…”
Hey,
Thanks for providing more info. After investigating a bit it looks like some translation files from Lang directory have some blank space (which I was not able to find btw) but PHP CS Fixer (https://github.com/FriendsOfPHP/PHP-CS-Fixer ) fixed it properly. Send me an email to stojanovic.loshmi at gmail.com and I will send you the updated files.
Btw, I will release a new version of the script pretty soon, which will address this as well as few other small bug fixes.
Regards,
Milos
hello dear my support time is over and I can not use my card to renew it now. I have problem with the login to my script on sub domain the user can login with google mail in my main domain at: uhd.edu.iq/barewbar/ but when I use my script on subdomain then google login don’t work I create a new login api for subdomain but it dosnt work portal.uhd.edu.iq/login.php please help me about that or tell me how can I redirect my google user after login to my subdomain script and login in subdomain? regards
Hey,
I’m really sorry but, as you said, your support has expired and I really only answer to some app related questions for users with valid support.
Please extend the support if you need my help.
Regards,
Milos
Hi, what’s the difference between this and Vanguard?
Hey,
Well, Vanguard is much more complex application than AS. It has a lot of other features that AS does not have (Activity Log, Sessions etc) and it is written in Laravel PHP framework, which means that you must be familiar with Laravel to be able to customize and modify it.
If you are not sure which one is right for you, I would recommend you to go through the documentation for each of those two apps and play with the demo versions available online. It should be more than enough for you to figure out which one will work better for you.
Regards,
Milos
Hey, I’ve another question, well more of a request actually.
I’ve a big list of users I need to add, and I wanna avoid the dull routine of adding one by one.
Could you provide a MySQL query I could run to import those from another table? Or what do you recommend me to do?
Thanks!
Hey,
I would recommend you to write a PHP script to import them, since that’s easier than just copying them from one table to another with SQL because there are probably a lot of differences between schema for those tables.
Unfortunately, I don’t have any script to send you that you can use but if you are familiar with Laravel, you can easily do it within Vanguard itself and make use of Eloquent ORM to make this easier for you.
One thing to note, since passwords for your users are most likely hashed with some other hash algorithm, different than bcrypt that Vanguard/Laravel uses, so you will need to notify the users that they should reset their password after you migrate them, since they won’t be able to log in if they don’t reset it.
Regards,
Milos
Hey, love your script.
How can I do to male the email field optional when adding users? Since I don’t need the email for some accounts.
Thanks!
Hey,
Well, you will need to modify client side and server side validation to accomplish that.
For client side, you should check register.validateRegistration function inside ASLibrary/js/register.js file.
For server side validation, check validateUser method inside ASEngine/ASRegister.php class.
Keep in mind though that email confirmation won’t work if email is not provided during the registration, so most likely you will have to turn it off.
Regards,
Milos