Anonymous avatar Anonymous committed 5359668

添加login

Comments (0)

Files changed (4)

         user = users.get_current_user()
         if user:
             return self.redirect(users.create_logout_url("/"))
+        
+class LoginHandler(PublicHandler):
+    def get(self):
+        user = users.get_current_user()
+        if user and users.is_current_user_admin() :
+            return self.redirect("/a/upload/")
+        return self.redirect(users.create_login_url("/a/upload/"))
        
 def main():
     application = webapp.WSGIApplication ([
                                        ('/e/(?P<key_name>[a-z0-9]+)/?',ImageDownloadHandler),
                                        ('/u/',ImageUploadHandler),
                                        ('/logout/',LogoutHandler),
+                                       ('/login/',LoginHandler),
                                         ],
                                          debug=settings.DEBUG)
     util.run_wsgi_app(application)

themes/admin/base.html

 				<a href="/a/settings/">系统设置</a>|
 				<a href="/a/antileech/">防盗链</a>|
 				<a href="/a/copy/">一键复制</a>|
-				<a href="/a/api/">API设置</a>
+				<a href="/a/api/">API设置</a>|
 				<a href="/logout/">退出</a>
 			</h2>
 			{% block content %}{% endblock %}

themes/default/base.html

 			{% block content %}{% endblock %}
         </div>
 		<div id="footer">
-                <p>Powered by <strong><a href="http://sa3.org/program/gae-album/" target="_blank" title="GAE 相册 图片">sa3album {{settings.version}}</a></strong> Hosted on Google App Engine.<a href="/a/upload/">管理登陆</a></p>
+                <p>Powered by <strong><a href="http://sa3.org/program/gae-album/" target="_blank" title="GAE 相册 图片">sa3album {{settings.version}}</a></strong> Hosted on Google App Engine.<a href="/login/">管理登陆</a></p>
 		</div>
     </body>
 </html>

themes/gallery/base.html

 			{% block content %}{% endblock %}
         </div>
 		<div id="footer">
-                <p>Powered by <strong><a href="http://sa3.org/program/gae-album/" target="_blank" title="GAE 相册 图片">sa3album {{settings.version}}</a></strong> Hosted on Google App Engine.<a href="/a/upload/">管理登陆</a></p>
+                <p>Powered by <strong><a href="http://sa3.org/program/gae-album/" target="_blank" title="GAE 相册 图片">sa3album {{settings.version}}</a></strong> Hosted on Google App Engine.<a href="/login/">管理登陆</a></p>
 		</div>
     </body>
 </html>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.