tkself

Instructions for use:

The Settings:

The settings-file at /conf/tk_settings.php defines the features tk_self should use: the template engine, the database, user authorization, roles and sessions.

Template engine:

// define the template engine to use:
// you can choose between php, phptal and smarty
//define ("TK_SELF_TEMPLATE_ENGINE", TK_SELF_TE_PHP);
define ("TK_SELF_TEMPLATE_ENGINE"TK_SELF_TE_PHPTAL);
//define ("TK_SELF_TEMPLATE_ENGINE", TK_SELF_TE_SMARTY);

For using a template engine, decomment the line defining the one you want to use. You can choose between PHP, PHPTAL and Smarty. In the example above PHPTAL has been choosen.

If, by mistake, you decomment more than one template engine, the first definition of TK_SELF_TEMPLATE_ENGINE will rule, because in PHP it is not possible to overwrite or redefine constants.

Database:

You have the option to use PostgreSQL or MySQL:

// for database use:
define ("TK_SELF_DATABASE_USE"true);  // set true to activate
define ("TK_SELF_DATABASE_TYPE""pgsql");  // set this to pgsql or mysql
define ("TK_SELF_DATABASE_HOST""127.0.0.1");  // default: localhost
define ("TK_SELF_DATABASE_PORT""5432");  // 5432 for psql, 3306 for mysql
define ("TK_SELF_DATABASE_USER""user");  // the dbuser-name
define ("TK_SELF_DATABASE_PASSWORD""pw");  // the dbuser-password
define ("TK_SELF_DATABASE_NAME""dbname");  // name of the database to use

In the above settings the use of a PostgreSQL-database is activated and the informations about connection, user, password and databasename to use are defined. Change the database-type from "pgsql" to "mysql" to use MySQL. For further details see the Database-chapter.

User authorization:

// for authorization use:
define ("TK_SELF_AUTHORIZATION_USE"true);  // set true to activate
define ("TK_SELF_ACTIVATE_ADMIN"true);  // for development, if there is no
                                          // user in the database.
define ("TK_SELF_ADMIN_USERNAME""admin");
define ("TK_SELF_ADMIN_PASSWORD""admin");
define ("TK_SELF_ADMIN_ROLE""admin");

// available user roles:
$TK_SELF_USER_ROLES = "user, admin";

With user authorization enabled it is possible to track registered users after login. Roles can be used to give them different rights. The roles used in the application are defined in the $TK_SELF_USER_ROLES-list. In production mode it is very important to set TK_SELF_ACTIVATE_ADMIN to false! See the Authentication-chapter for details.

Sessions:

define ("TK_SELF_USE_SESSIONS"true);  // set true to activate sessions.

With sessions it is possible to save client states independent from tracking authenticated users. See the Sessions-chapter.

Contact | Impressum | License