Giter Club home page Giter Club logo

django-moinmoin's People

Stargazers

 avatar

Watchers

 avatar  avatar

django-moinmoin's Issues

Breaks other auth methods when used in a chain

What steps will reproduce the problem?
1. in Wiki config, define auth to be [MoinAuth(),DjangoAuth(autocreate=True)
2. update the wiki with a request using Django credentials
3. update the wiki with a request using Moin credentials - it fails

What is the expected output? What do you see instead?

Expect to see an update in the wiki using MoinAuth credentials, but instead see 
an invalid login.

What version of the product are you using? On what operating system?

Moin 1.9.2

Please provide any additional information below.

Here's the patch I used to fix it, copied from the internal GivenAuth method;

*** djangoAuth1.py  2010-10-10 09:23:18.155189239 -0400
--- djangoAuth.py   2010-10-10 09:23:27.456642073 -0400
***************
*** 102,107 ****
--- 102,114 ----
          # user_obj = kw.get('user_obj')  # +++ example does not use this
          # username = kw.get('name') # +++ example does not use this
          # logout = kw.get('logout') # +++ example does not use this; logout is expected in other application
+ 
+         if user_obj and user_obj.auth_method == self.name:
+             user_obj = None
+ 
+         if user_obj and user_obj.valid:
+             return user_obj, False
+ 
          import Cookie
          user = None  # user is not authenticated
          try_next = True  # if True, moin tries the next auth method in auth list

Original issue reported on code.google.com by mark%[email protected] on 10 Oct 2010 at 1:27

session decoding simplification (tested with moinmoin 1.8.5 and django 1.1.0

Hi there,

as i've not found patch submissions or just ideas submission, i just post
here something that perhaps could help.

in DjangoAuth.py, get_session and get_decoded could be modified in order to
respect more easily django settings (crypt or sha1 encodings, pickle or
database session persistence,...) :

    def get_session(self, session_id):
        from django.contrib.sessions.models import Session
        try:
            session = Session.objects.get(session_key=session_id)
        except Session.DoesNotExist:
            return False, ''
        try:
            from datetime import datetime
            #Has the session expired?
            if session.expire_date < datetime.now():
                return False, ''
            return True, session  # here you return session directly
        except:
            return False, ''

    def get_decoded(self, session): # simpler version :)
        try:
            return session.get_decoded()
        except:
            return {}

another thing could be done in __init__ in order to get all django settings
and not only some of them (as i used django and moinmoin in merge WSGI
settings, if you connect to moinmoin then go to django, the WSGI process
will only have some of django settings with the current code). As i do not
manage several django on same OS, i have choosen os.environ settings that's
possible if you use only one django instance in your os partition server:

        from django.conf import settings
        if <your django project parent directory> not in sys.path:
sys.path.append(<your django project parent directory>)
        if <your django project directory> not in sys.path:
sys.path.append(<your django project directory>)
        import <your django project name>.settings
        import os
        os.environ['DJANGO_SETTINGS_MODULE'] = '<your django project
name>.settings'

For example :
<your django project parent directory> : /home (where you've used
django-admin.py startproject mysite)
<your django project directory> : /home/mysite

You can also remove third assumptions as i'm using it on windows xp pro if
you just replace in writeLog(*args):

log = open('/<your log path>/djangoAuthMoinMoin.log', 'a')

a best thing will be to set a variable at the begin of the file (like
TMP_LOG=/tmp/ # +++ windows users should set a viable path here). you can
also use logging module.

regards,

bruce vinchon.

Original issue reported on code.google.com by [email protected] on 3 Oct 2009 at 6:11

Apache configuration

I am a little confused about the required settings to get this working. Are 
the wiki the admin site required to be on the same host *.domain.com or must 
they be configured to share the same VirtualHost in Apache?

Original issue reported on code.google.com by [email protected] on 29 Aug 2009 at 2:13

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.