Posts

Showing posts with the label login

How to hide the "Manage databases" link from the Odoo's login link

There is one dangerous setting in Odoo that beginners like me hardly notice: the "Manage databases" link on the login link. Follow that link you will be able to know the database name, create new databases, destroy the current one etc... Even though it may require a master password for all the operations, exposing those functionalities to the public is quite dangerous. Here is how you can hide that link: 1. Edit the odoo's setting: sudo nano /etc/odoo/odoo.conf 2. Modify this line as follows: ... list_db = False ... 3. Save and restart odoo sudo systemctl restart odoo Notes: For those who run odoo in docker, follow these steps instead: 1. Copy the odoo's setting file to the host machine: docker cp 05829b85c385:/etc/odoo/odoo.conf . 2. Edit the file like above 3. Copy the setting file back to the odoo docker instance: docker cp odoo.conf 05829b85c385:/etc/odoo/odoo.conf 4. Restart docker instances (including Postgres instance) sudo...

Open edX - Login/Register submit button disabled after the first fail attempt

Image
The default login/registration form of Open edX has a bug that will disable the submit button after the first fail attempt and seem like no one want to fix it. Fortunately, you can use the combined login/registration form which does not have that bug. You enable it by enable the following feature flag: "ENABLE_COMBINED_LOGIN_REGISTRATION": true If you're using a custom comprehensive theme, you need to set it as a Site Configuration flag in the Django Admin. But if you're not using a custom theme, you can just set it in your /edx/app/edxapp/lms.env.json file, under the FEATURES list. Then restart your apps and enjoy: $ /edx/bin/supervisorctl restart all

Moodle user keeps being redirected to user profile page after login and how to fix

One day you noticed a user keeps being redirected to the Moodle's user profile page after she successfully log in and you cannot do anything. I got that problem too and it took me a while to figure out how to fix it. Login to Moodle using an administrator account and update all the required field of that user. Save it and everything will be ok. It's because for some reason your user missing some required information (such as email address in my case). You will wonder how this happens because you cannot create a user if you don't input all the required information. But, there is one scenario this will happen, It's LDAP. When a user login into Moodle the first time, Moodle will create the user as long as it has username. In my case, the user has everything it needs except for the email address. Interesting right? :D

How to fix Google Drive app hangs at "one moment please..."

I was trying to install google drive app on my Windows server 2012 R2 and after I entered all the login information, the app hang up at "one moment please..." which is forever. So here is a fix: Open Control Panel Go to Network and Internet Go to Internet Options Open Security Tab Click Trusted sites Click the "site" button Copy & paste https://accounts.google.com to "Add this website to the zone" and click Add button Try to login again to Google Drive app and everything will be ok.

Moodle with SSL behind Varnish

Ok, after a whole morning working on my moodle server, I finally made it work with SSL while standing behind a Varnish cache server. Things are just as simple as the following steps: A. Moodle Server Configuration: 1. Moodle's config.php: tell moodle to acknowledge the ssl proxy (the varnish) and provide users access via SSL link ... $CFG->wwwroot   = 'https://mymoodle.com'; $CFG->sslproxy  = true; ... 2. Nginx's configuration: one important thing here is that we still have to config the nginx to serve moodle at port 80 (without ssl) despite the moodle's configuration server {         listen 80;         root /var/www/moodle;         index index.php index.html index.htm;         server_name mymoodle.com;         access_log   /var/log/nginx/moodle-access.log;         error_log    /var/log/nginx/moodle-error.log;  ...

Automatically add new created users (by email or ldap login) to a project in Redmine

Alright, just got this to work a couple minutes ago: * I'm using the Redmine's rake to create issues by fetching email messages ( read this ): RAILS_ENV="production" /usr/bin/rake redmine:email:receive_imap host=imap.gmail.com port=993 ssl=1 username=myemailusername@mydomain.com password=myPassword project=helpdesk unknown_user=create no_permission_check=1 no_account_notice=1 Project id: helpdesk Default user role: Customer * If the email address of the sender is not in Redmine's db, it will create a new user with that email. Let call it joeuser . The problem is the new created user was not added to the project ('helpdesk'), so she will not receive any follow-up email messages (any updates of the ticket). So, I have to modify the Redmine's core to add the new user to the helpdesk project with the Customer role: 1. New user created by the Email task: /path/to/redmine/app/models/mail_handler.rb if addr && !addr.spec.blank?...

How is the PowerSchool admin login form processed?

Understand how PowerSchool works is very important if you're working as a developer at a school which is using PowerSchool as the Student Information System. PowerSchool is a big web application with a lot of components working together. It will take a huge amount of time to master all of them, so to get started, I will go through the admin login process of PowerSchool. 1. The first time you access the admin login page (http://mydomain.com/admin/pw.html), PowerSchool will give you a random token, pstoken input field of LoginForm: <input type="hidden" name="pstoken" value=" 20233460462xtw69pPuoIBNJ1RyLBnKsfuykVNlJzd "> 2. The admin user input username and password into the form (in the form of < username;password >), and press submit button. 3. Before the form's data is sent to PowerSchool server, the password is hashed using base64 md5 and then hashed again with the token provided in step (1) If the user is a ldap user, the l...

Accept both username and email address as login identity in simplesamlphp

By default, simplesamlphp only allow you to login by username. But, you hack the source code to make simplesamlphp accept both username and email address as login identity. The solution is pretty simple: + just take the input username and check if -- it is an email than split the string, get only the username part -- it is not an email, than use the input string # nano /path/to/simplesamlphp/modules/core/www/loginuserpass.php ... function get_username($un) {         if (strpos($un,'@') !== false) {                 $un = strstr($un, '@', true);         }         return $un; } if (array_key_exists('username', $_REQUEST)) {         $username = get_username($_REQUEST['username']); } elseif ($source->getRememberUsernameEnabled() && array_key_exists($source->getAuthId() . '-username', $_COOKIE)) {         $usernam...