jotwebutils

  1. Introduction
  2. jotwebutils Methods

Introduction

This module provides some useful utility functions for jotweb programs.

jotwebutils Methods

checkcryptpasswd(plaintext, crypted)

Arguments:

Returns: (integer) True if the passwords are the same, otherwise False.

Description: Check the plaintext password against an encrypted version (as returned by "cryptpasswd()" function).

cryptpasswd(passwd, md5 = False)

Arguments:

Returns: (string) The crypted password.

Description: One-way encode the plain-text password into a crypted form. The idea is that this string may be stored in a table for verification of authentication. The crypted version is not reversable, and therefore if it is exposed may not compromise the account it is protecting.

Note that if the crypted password is exposed, it does allow an attacker the ability to run a dictionary attack. Selecting good passwords is always a good idea. MD5 crypted passwords are slightly more resistant to dictionary attacks.

getGlobal(name)

Arguments:

Exceptions: KeyError is returned if there is no global variable with the specified name.

Returns: The value of the specified variable.

Description: This looks up a variable in the TAL global name-space. This can be used by Python code to gain access to variables defined in TAL.

getLocal(name)

Arguments:

Exceptions: KeyError is returned if there is no global variable with the specified name.

Returns: The value of the specified variable.

Description: This looks up a variable in the TAL local name-space. This can be used by Python code to gain access to variables defined in TAL.

getNSRoot()

Arguments: None

Exceptions: None

Returns: The root JOTWeb name-space dictionary object.

Description: This function returns the root of the JOTWeb name-space. See the JOTWeb name-space section of the User's Guide.

redirect()

Arguments:

Exceptions: RedirectException which triggers JOTWeb to generate a redirect.

Returns: None.

Description: Calling this function causes a redirect to be triggered which directs the browser to load the specified page. In particular, it causes the web server to generate a "moved temporarily" result.

Index