cakephp 3 application transfer to webhoster - database

I'm trying to transfer a cakephp3 application from my local linux server to a online webhoster.
I managed to migrate the database and put it online. The only way to connect to the internet for me is through a proxy right now. However this proxy blocks the website, so I'm using a webproxy (proxfree.net and hide.me) to access the website.
Whenever I try to login I get a 'invalid username or password'.
When I try to create a new user, it saves a record, but with an empty field for the pseudonym (username).
I wrote a test for the database connection
$db = ConnectionManager::get('default');
echo "To database ".($db->isConnected()?"connected":"disconnected")."\n";
It says it's connected to the database. I'm also able to print the usernames on the login-site, so the database-connection works definitely.
Login: marcusmoenius.bplaced.net/app/users/login
Add user: marcusmoenius.bplaced.net/app/users/add
Does anyone know, why I can't login? Is anyone else able to login? It worked on my local machine
example username and password:
username: Stella
password: Superman

OK, so it was no problem with the webspace, but with my understanding of the cakephp-functionality.
Apperantly the passwords-hashes don't match on the webhoster. So I needed to add new users with new-hashed passwords.
But the registration of new users didn't work, because I marked the pseudonym-field as not _accessible in the users-table. So when I invoked the patchEntity-method in the controller, it didn't apply the pseudonym-field and hence didn't put a valid record in the database.

Related

How to recover or reset password of C1-CMS admin?

In a self-hosted C1-CMS (formerly Composite C1), how can I reset or recover the password? Can the password be viewed or reset somewhere on the server?
(Composite C1 4.3, Build 4.3.5555.25838)
If you are using the default XML data store, the users and encrypted passwords are stored in: /App_Data/Composite/DataStores/Composite.Data.Types.IUser.xml
If you have another user with a password you know, you can replace the encrypted password string on the account you are trying to access, with the encrypted password from the account you know. Then login and change the password.
I received this answer from the official Orckestra support team (very helpful, although I am not a paying customer, thumbs up!):
You cannot recover the password, but if you have access to the files (or SQL Database, if you migrated data to SQL) you can reset the password:
This should work for sites running on XML data store (default):
Edit the file ~/App_Data/Composite/DataStores/Composite.Data.Types.IUser.xml
Locate the xml element for the user you want to reset the password for
Change the following two attributes to the shown values:
EncryptedPassword="hsfIeqkVA5yoMIwzYIx4fWny5GjwNwiM3wA5K+9qCug="
PasswordHashSalt="/zgEhlwBe6Vl0HHqMFPxafrtwqlRIGVS"
Save the file.
If your site is on SQL, locate the table Composite_Data_Types_IUser_Published and put the above shown values into the corresponding columns (EncryptedPassword and PasswordHashSalt).
You should now be able to log in using the password "123456" for the user you changed above. Once in the CMS Console, you can set a new password using the top Tools menu (top right user menu n V5 and later).
I recently had a scenario where neither of the suggested methods would work for me. I was able to remedy this by creating a c1 instance locally, creating a user with the same username and the desired password, and then overwriting the password salt and hash from the local site to the one you're locked out of.

How to use Wordpress function with new database

I am working on WordPress registration and login functionality. Actually I have 10 sites and I am making a single database table where these 10 sites can easily login and registered with same email and password. I mean same email and password can apply on these 10 sites login form through this single database table.
In my 10 sites there is one WordPress site. So I want the customize the registration and login functionality of this.
For my WordPress site I have make connect it with new database like:
$mydb = new wpdb('user','password','database','hostname');
after that I have check the database connection. it is working properly
Now I am getting a problem. I want to create a new user through this function
wp_create_user( $sanitized_user_login, $_POST['password'], $user_email );
when i am calling it through my new database connection like:
$mydb->wp_create_user( $sanitized_user_login, $_POST['password'], $user_email );
it is giving me blank result. So please tell me how can i get the all function of WordPress and use it for new database connection and create a new user in new database
Thanks
wp_create_user is a wordpress function
wdpb is used to work with db tables, there is no function wp_crete_user in wpdb. So you need to read the doc to know how to add a user in users table wpdb

New Joomla Database Password

I have created a new Joomla database (different from the main database of the website but that will be having its I/O from the same website nonetheless) and added a user to it. It seems that the database password was generated automatically and now Fabrik is asking me to confirm the database password but I can't find it in the configuration.php file (presumably because it is new) or anywhere else. Is there anything I am missing? Where can I find that password or change it?
The only location in joomla where you will find the database password is in the configuration file assigned to the $password variable.
If it is not there then you will need to look in the backend (cpanel?) where you will be able to set a new one.

store username and password in DB then use to access different service

I am building a web service that will allow the user to login and then it will download all there timetable data from another site (Which I don't own). I want to only need them to enter there username and password once to login to my service then to use it again to login to the next. I need to store there downloaded data against there user details, but I know I have to hash the password for security reasons in the DB so how can I use this to login to the second service. I though of unhashing but that defeats the whole point of hashing in the first place.
The reason I want to do this is so that the timetabe can then be downloaded to an android app so it can be viewed when there is no data connection.
Any Ideas would be helpful.
if those services gives you a "Token" after you login , you can store that in your database to access again to those services, so when the user logged on your webservice , before hash their information you can use it to login to the others services, and then store their "Token"
this approach only works if they give you something like a token after login, if they dont, i think you will need store the login information as it is , and at least encode on base64, that is not that secure but not that obvious
other idea is maybe create a separate database with only the login information and can be access only with their login (hashed) , but that means you need to create an user on your database and grant access only to that specific DB ,read-only
im sure there are more solutions, but hope that it can be helpful

User is not able to log in after some time

I am using asp.net mvc along with SQL server. An user of my application created a username like "abcd efgh", with space between the user name. it worked for some time and now it stopped working. I checked that user is entering the correct data. This happened even user did not have a space in it. I set up the membership database using Aspnet_regsql.exe.
Any help in trouble shooting this is appreciated.
Are you sure that you are not parsing/modifying the username or password before giving it to Membership?
Why don't you set a breakpoint in your Controller Action and see what username and password are at that point?

Resources