Merge branch 'refs/heads/0.6'
authorSofia Papagiannaki <papagian@gmail.com>
Fri, 1 Jun 2012 14:40:55 +0000 (17:40 +0300)
committerSofia Papagiannaki <papagian@gmail.com>
Fri, 1 Jun 2012 14:40:55 +0000 (17:40 +0300)
Conflicts:
docs/source/backends.rst
docs/source/conf.py
docs/source/devguide.rst

snf-astakos-app/Changelog
snf-astakos-app/astakos/im/api/admin.py
snf-astakos-app/astakos/im/functions.py
snf-astakos-app/astakos/im/migrations/0007_auto__chg_field_astakosuser_email_verified__chg_field_astakosuser_has_.py [new file with mode: 0644]
snf-astakos-app/astakos/im/static/im/js/jquery.infieldlabel.js
snf-astakos-app/conf/20-snf-astakos-app-cloudbar.conf
snf-astakos-app/conf/20-snf-astakos-app-settings.conf

index ef0a3ba..329f054 100644 (file)
@@ -1,33 +1,56 @@
 Changelog
-*********
+---------
+
+dev
+^^^
+- Fixed default values in cloudbar sample conf file
+
+v0.5.1
+^^^^^^
+- Change next parameter to index page in activate url.
+- Fix shibboleth login link.
+
+
+v0.5.0
+^^^^^^
+- Improvements and fixes in shibboleth integration.
+- Minor code refactoring (removed unsed classes/functions).
+- Rate limit integration (requires django-ratelimit).
+- New setting added, ASTAKOS_RATELIMIT_RETRIES_ALLOWED
+- get_menu api call checks the ASTAKOS_COOKIE_NAME instead of the sessionid cookie.
+- Management commands improvements/fixes
+- Altered blank/null parameters for some AstakosUser fields (db migration
+  required, ``snf-manage migrate``)
+- Added user group functionality (initial group data can be loaded using
+  ``snf-manage loaddata groups``)
 
 v0.4.0
-=======
+^^^^^^
 - User terms.
 - Styling fixes/improvements.
 - Configurable recpatcha form field.
 
 
 v0.3.9
-======
+^^^^^^
 - Show user email in feedback email content
 
 
 v0.3.8
-======
+^^^^^^
 - New ASTAKOS_PROFILE_EXTRA_LINKS setting to display additional buttons on
   account pages.
 
 
 v0.3.7
-======
+^^^^^^
 - New ASTAKOS_LOGIN_MESSAGES setting to display messages on the login page
   header
 - login_base.html to make it easy override the login.html template
 
 
 v0.3.5
-======
+^^^^^^
 - New grnet styles
 - New setting for recaptcha to use SSL
 - New menu texts
@@ -35,13 +58,13 @@ v0.3.5
 
 
 v0.3.4
-======
+^^^^^^
 - Updated mail contents
 - Cloudbar improvements
 
 
 v0.3.3
-======
+^^^^^^
 - Updated grnet styles
 - Several styling fixes
 - Display page menu
@@ -52,13 +75,13 @@ v0.3.3
 - Updated snf-common dependency to >=0.9.0
 - New ASTAKOS_RE_USER_EMAIL_PATTERNS setting
 - Support for multiple accounts authentication 
-- New --set-active and --set-inactive in modifyuser command
+- New ^^set-active and ^^set-inactive in modifyuser command
 - Fixed circular redirects when visiting login page from the logout one
 - Removed im.context_processors.cloudbar (now using snf-common processor)
 
 
 v0.3.2
-======
+^^^^^^
 - improved styles of sign up button
 - do not send admin notification email if ASTAKOS_DEFAULT_ADMIN_EMAIL is not 
   set 
@@ -66,7 +89,7 @@ v0.3.2
 
 
 v0.3.1
-======
+^^^^^^
 - bug fixes
 - administrator email notification on sign up 
   (configurable from ASTAKOS_DEFAULT_ADMIN_EMAIL setting)
index 27d4f12..1c5642a 100644 (file)
@@ -131,7 +131,8 @@ def authenticate_old(request, user=None):
                  'auth_token_created':user.auth_token_created.isoformat(),
                  'auth_token_expires':user.auth_token_expires.isoformat(),
                  'has_credits':user.has_credits,
-                 'has_signed_terms':user.signed_terms()}
+                 'has_signed_terms':user.signed_terms(),
+                 'groups':[g.name for g in user.groups.all()]}
     response.content = json.dumps(user_info)
     response['Content-Type'] = 'application/json; charset=UTF-8'
     response['Content-Length'] = len(response.content)
@@ -249,4 +250,4 @@ def get_user_by_username(request, user_id, user=None):
     #                       unauthorised (401)
     #                       forbidden (403)
     #                       itemNotFound (404)
-    return _get_user_by_username(user_id)
\ No newline at end of file
+    return _get_user_by_username(user_id)
index 172e712..877acd4 100644 (file)
@@ -83,7 +83,7 @@ def send_verification(user, template_name='im/activation_email.txt'):
     """
     url = '%s?auth=%s&next=%s' % (urljoin(BASEURL, reverse('astakos.im.views.activate')),
                                     quote(user.auth_token),
-                                    quote(BASEURL))
+                                    quote(urljoin(BASEURL, reverse('astakos.im.views.index'))))
     message = render_to_string(template_name, {
             'user': user,
             'url': url,
@@ -272,4 +272,4 @@ class SendFeedbackError(SendMailError):
 class ChangeEmailError(SendMailError):
     def __init__(self):
         self.message = _('Failed to send change email')
-        super(ChangeEmailError, self).__init__()
\ No newline at end of file
+        super(ChangeEmailError, self).__init__()
diff --git a/snf-astakos-app/astakos/im/migrations/0007_auto__chg_field_astakosuser_email_verified__chg_field_astakosuser_has_.py b/snf-astakos-app/astakos/im/migrations/0007_auto__chg_field_astakosuser_email_verified__chg_field_astakosuser_has_.py
new file mode 100644 (file)
index 0000000..5aa8322
--- /dev/null
@@ -0,0 +1,133 @@
+# encoding: utf-8
+import datetime
+from south.db import db
+from south.v2 import SchemaMigration
+from django.db import models
+
+class Migration(SchemaMigration):
+    
+    def forwards(self, orm):
+        
+        # Changing field 'AstakosUser.email_verified'
+        db.alter_column('im_astakosuser', 'email_verified', self.gf('django.db.models.fields.BooleanField')(blank=True))
+
+        # Changing field 'AstakosUser.has_credits'
+        db.alter_column('im_astakosuser', 'has_credits', self.gf('django.db.models.fields.BooleanField')(blank=True))
+
+        # Changing field 'AstakosUser.date_signed_terms'
+        db.alter_column('im_astakosuser', 'date_signed_terms', self.gf('django.db.models.fields.DateTimeField')(null=True, blank=True))
+
+        # Changing field 'AstakosUser.is_verified'
+        db.alter_column('im_astakosuser', 'is_verified', self.gf('django.db.models.fields.BooleanField')(blank=True))
+
+        # Changing field 'AstakosUser.has_signed_terms'
+        db.alter_column('im_astakosuser', 'has_signed_terms', self.gf('django.db.models.fields.BooleanField')(blank=True))
+
+        # Changing field 'Invitation.is_accepted'
+        db.alter_column('im_invitation', 'is_accepted', self.gf('django.db.models.fields.BooleanField')(blank=True))
+
+        # Changing field 'Invitation.is_consumed'
+        db.alter_column('im_invitation', 'is_consumed', self.gf('django.db.models.fields.BooleanField')(blank=True))
+    
+    
+    def backwards(self, orm):
+        
+        # Changing field 'AstakosUser.email_verified'
+        db.alter_column('im_astakosuser', 'email_verified', self.gf('django.db.models.fields.BooleanField')())
+
+        # Changing field 'AstakosUser.has_credits'
+        db.alter_column('im_astakosuser', 'has_credits', self.gf('django.db.models.fields.BooleanField')())
+
+        # Changing field 'AstakosUser.date_signed_terms'
+        db.alter_column('im_astakosuser', 'date_signed_terms', self.gf('django.db.models.fields.DateTimeField')(null=True))
+
+        # Changing field 'AstakosUser.is_verified'
+        db.alter_column('im_astakosuser', 'is_verified', self.gf('django.db.models.fields.BooleanField')())
+
+        # Changing field 'AstakosUser.has_signed_terms'
+        db.alter_column('im_astakosuser', 'has_signed_terms', self.gf('django.db.models.fields.BooleanField')())
+
+        # Changing field 'Invitation.is_accepted'
+        db.alter_column('im_invitation', 'is_accepted', self.gf('django.db.models.fields.BooleanField')())
+
+        # Changing field 'Invitation.is_consumed'
+        db.alter_column('im_invitation', 'is_consumed', self.gf('django.db.models.fields.BooleanField')())
+    
+    
+    models = {
+        'auth.group': {
+            'Meta': {'object_name': 'Group'},
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
+            'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
+        },
+        'auth.permission': {
+            'Meta': {'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
+            'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+            'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
+        },
+        'auth.user': {
+            'Meta': {'object_name': 'User'},
+            'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
+            'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
+            'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
+            'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
+            'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+            'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+            'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
+            'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
+            'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
+            'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
+            'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
+        },
+        'contenttypes.contenttype': {
+            'Meta': {'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
+            'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
+        },
+        'im.approvalterms': {
+            'Meta': {'object_name': 'ApprovalTerms'},
+            'date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2012, 5, 3, 11, 47, 35, 79841)', 'db_index': 'True'}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'location': ('django.db.models.fields.CharField', [], {'max_length': '255'})
+        },
+        'im.astakosuser': {
+            'Meta': {'object_name': 'AstakosUser', '_ormbases': ['auth.User']},
+            'affiliation': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
+            'auth_token': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
+            'auth_token_created': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),
+            'auth_token_expires': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),
+            'date_signed_terms': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
+            'email_verified': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+            'has_credits': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+            'has_signed_terms': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+            'invitations': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
+            'is_verified': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+            'level': ('django.db.models.fields.IntegerField', [], {'default': '4'}),
+            'provider': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
+            'third_party_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
+            'updated': ('django.db.models.fields.DateTimeField', [], {}),
+            'user_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True', 'primary_key': 'True'})
+        },
+        'im.invitation': {
+            'Meta': {'object_name': 'Invitation'},
+            'accepted': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
+            'code': ('django.db.models.fields.BigIntegerField', [], {'db_index': 'True'}),
+            'consumed': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
+            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'inviter': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'invitations_sent'", 'null': 'True', 'to': "orm['im.AstakosUser']"}),
+            'is_accepted': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+            'is_consumed': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+            'realname': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
+            'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'})
+        }
+    }
+    
+    complete_apps = ['im']
index 8664c1f..838941d 100755 (executable)
                        
                        // Remove keydown event to save on CPU processing
                        base.$field.unbind('keydown.infieldlabel');
+
+            // ff3.5 fix, forces key to be written in input field
+            base.$field.val('');
                };
       
                // Run the initialization method
index b22e8f8..7939864 100644 (file)
@@ -1,7 +1,5 @@
 #CLOUDBAR_ACTIVE = True
-#CLOUDBAR_LOCATION = '/static/im/cloudbar/'
+#CLOUDBAR_LOCATION = 'https://accounts.okeanos.grnet.gr/static/im/cloudbar/'
 #CLOUDBAR_COOKIE_NAME = '_pithos2_a'
-#CLOUDBAR_ACTIVE_SERVICE = 'cloud'
-#CLOUDBAR_SERVICES_URL = '/im/get_services'
-#CLOUDBAR_MENU_URL = '/im/get_menu'
-
+#CLOUDBAR_SERVICES_URL = 'https://accounts.okeanos.grnet.gr/im/get_services'
+#CLOUDBAR_MENU_URL = 'https://accounts.okeanos.grnet.gr/im/get_menu'
index 5aeaf34..5304184 100644 (file)
@@ -75,3 +75,6 @@
 # e.g. {'https://cms.okeanos.grnet.gr/': 'Back to ~okeanos'}
 #ASTAKOS_PROFILE_EXTRA_LINKS = {}
 
+# The number of unsuccessful login requests per minute allowed for a specific email
+#ASTAKOS_RATELIMIT_RETRIES_ALLOWED = 3
+