Closed MorganBeukes closed 7 years ago
Can you send a screenshot? Also ensure you downloaded the complete project, perhaps one or more files are missing.
Hello, i've got a problem. I can't log in, alwayes I have info "Log in failed. Please check your internet connection and try again later."
I have the same problem, it seems some folder/ files are missing :
the function handleLogin(....) in main.js is trying to ajax "appRoot+access/login", but there is no such directory in the whole project.
function handleLogin(email, password, callback){
var jsonToReturn = "";
$.ajax(appRoot+'access/login', {
method: "POST",
data: {email:email, password:password}
}).done(function(returnedData){
if(returnedData.status === 1){
jsonToReturn = {status:1, msg:"Authenticated..."};
}
else{
//display error messages
jsonToReturn = {status:0, msg:"Invalid email/password combination"};
}
typeof(callback) === "function" ? callback(jsonToReturn) : "";
}).fail(function(){
//set error message based on the internet connectivity of the user
var msg = "Log in failed. Please check your internet connection and try again later.";
@raymonduui There are no files missing. The URI "access/login" is be re-routed to "home/login".
Ensure your appRoot and the other setup steps are properly followed.
@raymonduui From your screenshot, I can see that you're trying to access localhost:8080/access/login. Is it that the app is directly (not in any folder) inside your public_html OR www OR htdocs etc folder?
@amirsanni
My App Location : C:\Apache24\htdocs\mini-inventory-and-sales-management-system (where index.php is located )
Launch the app via : localhost/mini-inventory-and-sales-management-system
In httpd.conf
DocumentRoot "c:/Apache24/htdocs/"
<Directory "c:/Apache24/htdocs/">
......
AllowOverride All
DirectoryIndex index.php
</Directory>
For .htaccess in the root mini-inventory-and-sales-management-system
Stays RewriteBase /mini-inventory-and-sales-management-system
For application/config/config.php
Stays ."/mini-inventory-and-sales-management-system/"
For public/js/main.js
Stays var appRoot = setAppRoot("mini-inventory-and-sales-management-system", "mini-inventory-and-sales-management-system");
Changed to sqlite, able to login with default email and password ,but redirected back to login page.... The front is stays in login page, but the back end is logged in already.
@raymonduui Can you share your config/config.php file? And maybe your config/database.php as well.
@amirsanni Thank you. in config.php, I only remove the "/mini-...." after $protocol.$host as above mentioned.
$host = $_SERVER['HTTP_HOST'];//e.g practa.ng || www.practa.ng || localhost
$protocol = is_https() ? "https://" : "http://";
if(is_cli()){
$config['base_url'] = "";
}
else if(stristr($host, "localhost") !== FALSE || (stristr($host, "192.168.") !== FALSE)|| (stristr($host, "127.0.0.") !== FALSE)){
$config['base_url'] = $protocol.$host;
}
else{
$allowed = ['www.1410inc.xyz', '1410inc.xyz'];//input all allowed urls here e.g. amirsanni.com, www.practa.ng, smartagapp.com
$config['base_url'] = in_array($host, $allowed) ? $protocol.$host: "http://".$_SERVER['HTTP_HOST']."/";
}
database.php is the same as from git, I didn't do any changes.
Add "/" after $protocol.$host
.
It should look like this $config['base_url'] = $protocol.$host."/";
@raymonduui Also ensure codeIgniter is able to connect to your database.
@amirsanni thank you for answering.
I have added the ."/" and codeigniter is conected database.. but the same.. which server are you using to set up ?
@raymonduui Apache2 and I didn't change the document root (htdocs) as set by xampp.
I have problem that all the time is Authenticating:
[image: Obraz w treści 1]
2017-09-07 12:14 GMT+02:00 Amir notifications@github.com:
@raymonduui https://github.com/raymonduui Apache2 and I didn't change the document root (htdocs) as set by xampp.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/amirsanni/Mini-Inventory-and-Sales-Management-System/issues/9#issuecomment-327757243, or mute the thread https://github.com/notifications/unsubscribe-auth/ANlhFFn7pfq56xxrnJHtudaBssHp_jNwks5sf8IKgaJpZM4PA374 .
-- Pozdrawiam, Grzegorz Dąbrowski
ERROR:
127.0.0.1/:86 GET http://127.0.0.1/public/js/main.js access.js:36 Uncaught ReferenceError: handleLogin is not defined at HTMLFormElement.loginForm.onsubmit (access.js:36)
2017-09-07 17:38 GMT+02:00 Grzegorz Dąbrowski grzesdab1@gmail.com:
I have problem that all the time is Authenticating:
[image: Obraz w treści 1]
2017-09-07 12:14 GMT+02:00 Amir notifications@github.com:
@raymonduui https://github.com/raymonduui Apache2 and I didn't change the document root (htdocs) as set by xampp.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/amirsanni/Mini-Inventory-and-Sales-Management-System/issues/9#issuecomment-327757243, or mute the thread https://github.com/notifications/unsubscribe-auth/ANlhFFn7pfq56xxrnJHtudaBssHp_jNwks5sf8IKgaJpZM4PA374 .
-- Pozdrawiam, Grzegorz Dąbrowski
-- Pozdrawiam, Grzegorz Dąbrowski
If you can help me per TeamViewer i would be very gratefull
2017-09-07 17:39 GMT+02:00 Grzegorz Dąbrowski grzesdab1@gmail.com:
ERROR:
127.0.0.1/:86 GET http://127.0.0.1/public/js/main.js access.js:36 Uncaught ReferenceError: handleLogin is not defined at HTMLFormElement.loginForm.onsubmit (access.js:36)
2017-09-07 17:38 GMT+02:00 Grzegorz Dąbrowski grzesdab1@gmail.com:
I have problem that all the time is Authenticating:
[image: Obraz w treści 1]
2017-09-07 12:14 GMT+02:00 Amir notifications@github.com:
@raymonduui https://github.com/raymonduui Apache2 and I didn't change the document root (htdocs) as set by xampp.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/amirsanni/Mini-Inventory-and-Sales-Management-System/issues/9#issuecomment-327757243, or mute the thread https://github.com/notifications/unsubscribe-auth/ANlhFFn7pfq56xxrnJHtudaBssHp_jNwks5sf8IKgaJpZM4PA374 .
-- Pozdrawiam, Grzegorz Dąbrowski
-- Pozdrawiam, Grzegorz Dąbrowski
-- Pozdrawiam, Grzegorz Dąbrowski
@Grzegorz07 Let's do teamviewer in 4hrs. i.e. 9pm GMT+1
ok, I will be waiting :) thx
2017-09-07 18:08 GMT+02:00 Amir notifications@github.com:
@Grzegorz07 https://github.com/grzegorz07 Let's do teamviewer in 4hrs. i.e. 9pm GMT+1
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/amirsanni/Mini-Inventory-and-Sales-Management-System/issues/9#issuecomment-327847097, or mute the thread https://github.com/notifications/unsubscribe-auth/ANlhFB2Dr6iPqUCdfVg6iqxLSCmRrlHpks5sgBT1gaJpZM4PA374 .
-- Pozdrawiam, Grzegorz Dąbrowski
your ID 292 891 474 password 9817
2017-09-07 18:17 GMT+02:00 Grzegorz Dąbrowski grzesdab1@gmail.com:
ok, I will be waiting :) thx
2017-09-07 18:08 GMT+02:00 Amir notifications@github.com:
@Grzegorz07 https://github.com/grzegorz07 Let's do teamviewer in 4hrs. i.e. 9pm GMT+1
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/amirsanni/Mini-Inventory-and-Sales-Management-System/issues/9#issuecomment-327847097, or mute the thread https://github.com/notifications/unsubscribe-auth/ANlhFB2Dr6iPqUCdfVg6iqxLSCmRrlHpks5sgBT1gaJpZM4PA374 .
-- Pozdrawiam, Grzegorz Dąbrowski
-- Pozdrawiam, Grzegorz Dąbrowski
I would need your help too but I am in timezone GMT+8 , so if possible can we do teamviewer too ? now my database is connected, all paths are correct, but the uri rewrite is not working, even backend is loaded in , front end is refreshed but back to login page.
@raymonduui when will you be available to do it? Now?
Nah not yet, I am still at work. but about 10PM (GMT+8 ), so 3PM (GMT +1 ) . Thanks
I won't be free at that time.
@amirsanni what time will you be free later today or Sat ?
8am GMT+1 tomorrow (Saturday). 3pm your time (I think)
Hello, I have the same problem, If you find the problem, Please write me
Dnia 08.09.2017 o godz. 09:52 Amir notifications@github.com napisał(a):
Today 8am GMT+1 tomorrow (Saturday). 3pm your time (I think)
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
@amirsanni I am ok at that time
All the time I have problem with session, when you find the answer, why session doesn’t work, please write me
dnia 8 września 2017 o 17:25:36, Raymond Chu (notifications@github.com) napisał:
@amirsanni https://github.com/amirsanni I am ok at that time
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/amirsanni/Mini-Inventory-and-Sales-Management-System/issues/9#issuecomment-328134738, or mute the thread https://github.com/notifications/unsubscribe-auth/ANlhFI4qcER8w7QnFcJXmjEsdr_Eou8sks5sgVxwgaJpZM4PA374 .
@amirsanni Hi, I didn't have your response on Sat, but I found the problem is the routing, as from the php log , "No URI present. Default controller set", which is causing redirect to the default controller : home.
Problem is : $_SESSION['admin_id'] is empty
What's your structure and settings in xampp ? so I can follow it and test.
Now my structure is
xampp
--htdocs
--mini-inventory-and-sales-management-system
--php
--mysql
@raymonduui Sorry I could not meet up on Saturday. I'm using the default xampp settings. That's the same is @Grzegorz07 is having. The session data gets destroyed almost immediately. Can't tell what could be causing that at the moment. I'll check and get back.
@Grzegorz07 @amirsanni I fixed the issue :
Go to system\libraries\Session\Session.php
Comment out both sections:
session_start();
at line 141
and
// Security is king
ini_set('session.use_trans_sid', 0);
ini_set('session.use_strict_mode', 1);
ini_set('session.use_cookies', 1);
ini_set('session.use_only_cookies', 1);
ini_set('session.hash_function', 1);
ini_set('session.hash_bits_per_character', 4);
at lines 313 to 319.
Add session_start();
in index.php at root directory to a new line after <?php
Disable those security settings should be okay.
Just realised the issue is CodeIgniter's (version used) compatibility with PHP 7. Switched the one online to PHP 7 and same thing happened. I'd rather just update the framework.
@raymonduui @Grzegorz07 I have updated the framework. You can re-download and test.
Thank you ! It works perfectly fine now :)
Welcome
hello I want to tell you that the system looks good but the login error is still unresolved please can you give me a hand with that I am new in this world of php
Check #35
What is the name of the folder the app is running from?
is a local server with ubuntu
\192.168.x.xxx\www\html
http://192.168.x.xxx/mini-inventory-and-sales-management-system/
Then you have to ensure your URL is well constructed i.e. really referencing that directory and that you have mod_rewrite enabled. From the screenshot, it says 404 Page Not Found meaning the link does not exist.
Also check the .htaccess file in the root directory. You should remove the directory name there since the app is hosted in the www/html directory.
is heading to this but it does not exist URL /mini-inventory-and-sales-management-system/access/login
Exactly what I said. It means the URL is not resolving properly.
change the name of all the files that you indicate but I am redirected to the same file I have to modify
jquery.min.js:4 POST http://192.168.1.136/mini-inventory-and-sales-management-system/access/login 404 (Not Found) send @ jquery.min.js:4 ajax @ jquery.min.js:4 handleLogin @ main.js:577 loginForm.onsubmit @ access.js:36
Did you check the .htaccess file?
<IfModule !mod_rewrite.c>
# can be sent to index.php, and everything works as normal.
# Submitted by: ElliotHaughin
ErrorDocument 404 /index.php
new error
RewriteBase /Inventory. Is the app inside a dir call Inventory? If no, remove Inventory and leave it as RewriteBase /.
As for the database error, this is a feature in the recent versions of mysql/mariadb. MySQL Doc. You will need to search on how to remove that restriction.
See this SO link on how to do that.
Error, Need help
An Error Was Encountered
Unable to load the requested class: Email