Changes between Version 4 and Version 5 of BluePrintRESTImplementation


Ignore:
Timestamp:
12/31/08 19:30:46 (13 years ago)
Author:
Fran Boon
Comment:

if t2.logged_in() for some methods only

Legend:

Unmodified
Added
Removed
Modified
  • BluePrintRESTImplementation

    v4 v5  
    11{{{
    22# RESTful controller function
    3 # Since some methods should require authentication, we must do so for all (unless we patch T2)
    4 @t2.requires_login('login')
    53def feature():
    64    if request.args:
     
    2119                return dict(module_name=module_name,modules=modules,options=options,item=item)
    2220            elif method=="update":
    23                 form=t2.update(db.gis_feature)
    24                 response.view='gis/update_feature.html'
    25                 return dict(module_name=module_name,modules=modules,options=options,form=form)
     21                if t2.logged_in:
     22                    form=t2.update(db.gis_feature)
     23                    response.view='gis/update_feature.html'
     24                    return dict(module_name=module_name,modules=modules,options=options,form=form)
     25                else:
     26                    t2.redirect('login')
    2627            elif method=="delete":
    2728                t2.delete(db.gis_feature,next='features')
     
    3132                return
    3233    else:
    33         # List Features (NB currently simple)
     34        # List Features
    3435        list=t2.itemize(db.gis_feature)
    3536        response.view='gis/list.html'