Permalink
Browse files

First time install detection.

  • Loading branch information...
1 parent 6682f3a commit 9e3e2938fcc184f404885d38bae76e9d0f717d31 ethem committed Mar 27, 2006
Showing with 19 additions and 16 deletions.
  1. +19 −16 enrol/authorize/db/mysql.php
View
35 enrol/authorize/db/mysql.php
@@ -1,15 +1,18 @@
-<?PHP //$Id$
-
-// MySQL commands for upgrading this enrolment module
-
-function authorize_upgrade($oldversion=0) {
-
- global $CFG, $THEME, $db;
-
- $result = true;
-
- if ($oldversion == 0) {
- modify_database("$CFG->dirroot/enrol/authorize/db/mysql.sql");
+<?PHP //$Id$
+
+// MySQL commands for upgrading this enrolment module
+
+function authorize_upgrade($oldversion=0) {
+ global $CFG, $THEME, $db;
+
+ $result = true;
+
+ if (!$tables = $db->MetaColumns($CFG->prefix . 'enrol_authorize')) {
+ $installfirst = true;
+ }
+
+ if ($oldversion == 0 || !empty($installfirst)) {
+ modify_database("$CFG->dirroot/enrol/authorize/db/mysql.sql");
}
if ($oldversion < 2005071601) {
@@ -27,7 +30,7 @@ function authorize_upgrade($oldversion=0) {
handling, please ensure that you have turned loginhttps ON in Admin >> Variables >> Security.");
}
- return $result;
-}
-
-?>
+ return $result;
+}
+
+?>

0 comments on commit 9e3e293

Please sign in to comment.