/[drupal]/contributions/modules/cram/cram.install
ViewVC logotype

Contents of /contributions/modules/cram/cram.install

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (show annotations) (download) (as text)
Sat Jan 26 05:03:17 2008 UTC (22 months ago) by selmanj
Branch: MAIN
CVS Tags: HEAD
Branch point for: DRUPAL-5, DRUPAL-6--1
Changes since 1.1: +6 -6 lines
File MIME type: text/x-php
Big changes.  Changed 'challenge id' to be called nonce, which is a better term for what it is.  Also made it so the challenge id no longer depends on the userid.  Because of this, we can embed it directly into the form, which greatly simplifies the javascript.  This also allows us to log in during maintanence mode, which wasn't possible before.  The table schema changed so the module needs to be reinstalled to use the new schema.
1 <?php
2 // $Id: cram.install,v 1.1 2007/12/12 06:10:20 selmanj Exp $
3
4 function cram_install() {
5 switch($GLOBALS['db_type']) {
6 case 'mysql':
7 case 'mysqli':
8 db_query("CREATE TABLE {cram_nonce} (
9 nonce varchar(32) NOT NULL default '',
10 issued int(11) NOT NULL default '0',
11 valid int(1) NOT NULL default '0',
12 PRIMARY KEY (nonce, issued)
13 ) /*!40100 DEFAULT CHARACTER SET utf8 */;");
14 break;
15 }
16 }
17
18 function cram_uninstall() {
19 db_query('DROP TABLE {cram_nonce}');
20 }

  ViewVC Help
Powered by ViewVC 1.1.2