콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
3 답글
31024 화면

I am working with OpenERP 7. I want to know how can I log in the server by just passing connection parameters in the URL (db, login, password).

Any idea how can we do that ?

아바타
취소

Hi, did you find the solution? I'm trying to do the same...

작성자

not found yet

I have this question too: http://help.openerp.com/question/39187/how-to-pass-login-and-password-parameters-to-user/ I will try do do this. If I have positive results I will share with you.

베스트 답변

Here is the URL string for seamless login from another page to openerp.

localhost:8069/login?db=nas&login=&key=

아바타
취소

This is working. Thanks Krishna

작성자

This works only if you have a single database in your server : add another database (nas2 for example) and try to connect to it .It will not work !!!

It will work. You have to select nas2 database first..

작성자

I will connect to my OpenERP server from another website, it means that l WILL NOT not use the default login page so how can I select the database which I want to connect to

베스트 답변

hi

Do you have any idea how to restrict the login process? I want to disable the login process in openerp after working hours. any idea how to do that and where can i find the codes for this login button..

 

아바타
취소

If anyone know this, please post it. Need help doing this

베스트 답변

Check the module web, it defines the login form and js files etc, check also the file res_users.py in module base/res/ and there is the login function defined.

def login(self, db, login, password):
    if not password:
        return False
    user_id = False
    cr = pooler.get_db(db).cursor()
    try:
        # autocommit: our single update request will be performed atomically.
        # (In this way, there is no opportunity to have two transactions
        # interleaving their cr.execute()..cr.commit() calls and have one
        # of them rolled back due to a concurrent access.)
        cr.autocommit(True)
        # check if user exists
        res = self.search(cr, SUPERUSER_ID, [('login','=',login)])
        if res:
            user_id = res[0]
            # check credentials
            self.check_credentials(cr, user_id, password)
            # We effectively unconditionally write the res_users line.
            # Even w/ autocommit there's a chance the user row will be locked,
            # in which case we can't delay the login just for the purpose of
            # update the last login date - hence we use FOR UPDATE NOWAIT to
            # try to get the lock - fail-fast
            # Failing to acquire the lock on the res_users row probably means
            # another request is holding it. No big deal, we don't want to
            # prevent/delay login in that case. It will also have been logged
            # as a SQL error, if anyone cares.
            try:
                cr.execute("SELECT id FROM res_users WHERE id=%s FOR UPDATE NOWAIT", (user_id,), log_exceptions=False)
                cr.execute("UPDATE res_users SET login_date = now() AT TIME ZONE 'UTC' WHERE id=%s", (user_id,))
            except Exception:
                _logger.debug("Failed to update last_login for db:%s login:%s", db, login, exc_info=True)
    except openerp.exceptions.AccessDenied:
        _logger.info("Login failed for db:%s login:%s", db, login)
        user_id = False
    finally:
        cr.close()

    return user_id

and check the methods authenticate, check and check_credentials also.

아바타
취소
작성자

I want to connect directly from the url like this localhost:8089/?db=dbname(other arguments)

I am not sure that you can do that, check the file main.py in module web/controllers/main.py. The URL and sessions are handled in it.

작성자

I asked a question ( help.openerp.com/question/36431/how-to-login-to-openerp-from-another-website/ ) and Fabien Pinckaers answered me " it's also possible to put login/pass in the url, but I don't remember what are the exact arguments"

작성자

Thank you Gopakumar, If you find a solution please tell me.

Check the module "auth_oauth" it is used for sign in to OpenERP from other accounts.

작성자

we want to pass connection parameters in the URL and not "sign in to OpenERP from other accounts."

I found it. This is the URL string http://localhost:8069/login?db=nas&login=&key=

관련 게시물 답글 화면 활동
1
5월 25
831
0
11월 24
1455
1
9월 24
1352
0
3월 24
1449
1
12월 23
7236