Esempio n. 1
0
if loggedInFlag:
    userData = mew.getUser(cookie_hash["userId"])
    userName = userData["userName"]
    userId = userData["id"]

    unamestr = "[" + str(userName) + "]"

    if userData["type"] == "anonymous":
        unamestr = "[" + str(userName) + "]"
        #print "Location:/register"
        #print cookie.output()
        #print
        #sys.exit(0)

if loggedInFlag:
    nav = mew.processLoggedInNavTemplate(nav, userData["userName"],
                                         userData["type"])
else:
    nav = mew.loggedOutNavTemplate(nav)

tmp_str = template

tmp_str = mew.replaceTemplateMessage(tmp_str, msg, msgType)

if loggedInFlag:
    tmp_str = tmp_str.replace("<!--BREADCRUMB-->",
                              mew.breadcrumb(str(userName), userId))
tmp_str = tmp_str.replace("<!--FOOTER-->", footer)
tmp_str = tmp_str.replace("<!--NAVBAR-->", nav)
tmp_str = tmp_str.replace("<!--ANALYTICS-->", analytics)

start = 0
Esempio n. 2
0
    print "Location:login"
    print cookie.output()
    print
    sys.exit(0)

#userName = userData["userName"]
projectUserId = mew.getProjectUserId(project["id"])
projectUserName = mew.getProjectUserName(project["id"])

message, messageType = mew.processCookieMessage(cookie, cookie_hash)

template = mew.slurp_file("template/project.html")
nav = mew.slurp_file("template/navbar_template.html")

if loggedInFlag:
    nav = mew.processLoggedInNavTemplate(nav, str(userName),
                                         str(userData["type"]))
else:
    nav = mew.loggedOutNavTemplate(nav)

footer = mew.slurp_file("template/footer_template.html")
analytics = mew.slurp_file("template/analytics_template.html")
permission_pane = mew.slurp_file("template/project_manage_pane.html")

tmp_str = template

if authorizedFlag:
    tmp_str = tmp_str.replace(
        "<!--PERMISSION_PANE_HEADER-->",
        "<li><a href='#PanelManage' data-toggle='tab'>Manage</a></li>")
    tmp_str = tmp_str.replace("<!--PERMISSION_PANE-->", permission_pane)
    privateChecked = "checked"