Odoo website, Creating a signup page for external users - python-2.7

How can I create a signup page in odoo website. The auth_signup module seems to do the job (according to their description). I don't know how to utilize it.
In the signup page there shouldn't be database selector
Where should I store the user data(including password); res.users or res.partner

you can turn off db listing w/ some params in in odoo.cfg conf
db_name = mydb
list_db = False
dbfilter = mydb
auth_signup takes care of the registration, you don't need to do anything. A res.user will be created as well as a partner related to it.
The pwd is stored in the user.

User Signup is a standard feature provided by Odoo, and it seems that you already found it.
The database selector shows because you have several PostgresSSQL databases.
The easiest way is to set a filter that limits it to the one you want:
start the server with the option --dbfilter=^MYDB$, where MYDBis the database name.
User data is stored both in res.userand res.partner: the user specific data, such as login and password, are stored in res.user. Other data, such as the Name is stored in a related res.partner record.

Related

How to change Django database user based on login user

Is it possible to change Django database user based on login user. I'm using postgres db.
I'm writting this answer according to my understanding of the question.
For your question yes, for example if you have an application and its support multiple users login consider 3 to 4 kind of users like..
Normal user
Superuser
And many more...
And if you want to switch between these users you have to made some uniqueness to find them while login. For that you should add an attribute (field) to your database table (for example user_role anyway you can give your own).
Note: you should predefined all the users in this table.
And while signing up, use this user_role(u should insert 4 user_type as already mentioned above ) and make it to foreign key to your users table.
So now you saved users by giving the user_role.
While login u should send the request containing user_role along with user_name and password.
{
"user_role" : 2
"user_name(or email)" : "***#gmail.com",
"password" : "****"
}
If you are not find this answer as more relevant please elaborate your question so someone can help you.
Happy coding!!

authenticate with different table in django and not User

hello I have created a table register_Recruiter which has email and password as two of its column. Now to authenticate, from front end ( React) I am sending a post request containing email and password.But I am not able to do that.I tried looking for tutorials but no luck. Do help!!
PS: new to django -rest-framework
This is more connected with Django itself. I guess, you need to add your new table into Django settings AUTH_USER_MODEL=YOUR_NEW_USER_TABLE

apex5.1, how to set custom login page

I need to set a custom page login in apex5.0
If login is invalid, the standard error msg should be displayed.
However, i have a table that contains an expiry date for the user. I want to add a check user is expired then he should not login the system and message 'No access' displayed. if sys_date > expiry_date.
How is it possible to do that?
The best way to do this is to create your own authentication scheme.
Create your own function which checks if username and password match with your user table, and then check if expiry_date > sysdate. Add a new authentication scheme (shared components -> authentication schemes -> create and select custom as the scheme type. Then add your function in there.

Sitecore ECM op-tin and opt-out roles dates

I want to know is there any way to get user subscrition / unsubscrition to email campaign ?
Is it saved in one of databases/tables in MSSQL ?
If you use the approach with opting in and out being determined on the fact if user is in role, then it is stored in the aspnet_UsersInRoles table in your core database. This table does not keep the information when role was assigned to the user. That's why you cannot get information when user subscribed or unsubscribed to email campaign.
The only thing you can check is if user is in the role:
user.IsInRole(roleName)
The user's subscription is driven by the users role, but It is possible to get the users subscriptions in ECM, You just have to use the api.
You can get the contact from the email address:
string fullName = commonDomain + "\\" + Util.AddressToUserName(username);
var contact = Contact.FromName(fullName);
var subscriptions = contact.GetSubscriptions();
Once you have a contact you can call the GetSubscriptions() method which will return the recipient lists the user is signed up to. There are a host of other methods you can call on a contact and if there is a a way to get the date unsubscribed/subscribed it will be here.
If not reflect Sitecore.EmailCampaign.dll and keep looking! There might be some extra information in the automation states table in the Analytics database. More info on automation state here:
https://www.sitecore.net/learn/blogs/technical-blogs/sitecore-magnified/posts/2013/09/ecm-automation-states-magic.aspx
Also noticed there is a method GetUnsubscribersStatistics on the Sitecore.Modules.EmailCampaign.Core.Analytics.AnalyticsHelper class. This will have the date of unsubscription.

List of users who registered in the same month as the logged user

I need to create a custom module which shows a list of users who registered in the same month as the logged user.
You have to start with learning how to create a joomla module.
Then to get familiar with joomla database functions.
Once you create the module, you have to get the active user using current user object.
Next step is to run a query to #__user_profiles table to get the active user register date. The query will be like:
SELECT `registerDate` FROM `#__user_profiles` WHERE `username` = $user_id
And then run a second query to get all users registered the same month as active user:
SELECT `username` FROM `#__user_profiles` WHERE MONTH(registerDate) = MONTH($current_user_register_date)
Good Luck!