Commit 649bb53e563bd33188a225861f7a7132b42f25ab
Merge branch 'edge' of git@github.com:ktgit/knowledgetree into edge
Showing
8 changed files
with
40 additions
and
75 deletions
lib/actions/bulkaction.php
| ... | ... | @@ -49,9 +49,7 @@ require_once(KT_LIB_DIR . '/documentmanagement/documentutil.inc.php'); |
| 49 | 49 | require_once(KT_LIB_DIR . '/widgets/forms.inc.php'); |
| 50 | 50 | |
| 51 | 51 | require_once(KT_LIB_DIR . "/util/sanitize.inc"); |
| 52 | - | |
| 53 | -// // Jarrett Jordaan: Deal with bulk action | |
| 54 | -require_once(KT_LIB_DIR . '/subscriptions/subscriptions.inc.php'); | |
| 52 | +require_once(KT_LIB_DIR . '/subscriptions/subscriptions.inc.php'); // Deal with bulk action | |
| 55 | 53 | |
| 56 | 54 | class KTBulkAction extends KTStandardDispatcher { |
| 57 | 55 | var $sName; |
| ... | ... | @@ -603,7 +601,9 @@ class KTBulkAction extends KTStandardDispatcher { |
| 603 | 601 | 'form' => $this->form_complete())); |
| 604 | 602 | } |
| 605 | 603 | |
| 606 | - // Jarrett Jordaan: Deal with bulk actions | |
| 604 | + /** | |
| 605 | + * Deal with bulk actions | |
| 606 | + */ | |
| 607 | 607 | function do_notification($objects, $eventAction, $targetFolder) { |
| 608 | 608 | // Make sure there were documents/folders affected |
| 609 | 609 | if ($targetFolder && count($objects) > 0 && $eventAction != '') { | ... | ... |
lib/foldermanagement/folderutil.inc.php
lib/import/bulkimport.inc.php
| ... | ... | @@ -40,8 +40,7 @@ |
| 40 | 40 | require_once(KT_LIB_DIR . '/foldermanagement/folderutil.inc.php'); |
| 41 | 41 | require_once(KT_LIB_DIR . '/documentmanagement/documentutil.inc.php'); |
| 42 | 42 | require_once(KT_LIB_DIR . '/filelike/filelikeutil.inc.php'); |
| 43 | -// // Jarrett Jordaan: Deal with bulk action | |
| 44 | -require_once(KT_LIB_DIR . '/subscriptions/subscriptions.inc.php'); | |
| 43 | +require_once(KT_LIB_DIR . '/subscriptions/subscriptions.inc.php'); // Deal with bulk action | |
| 45 | 44 | |
| 46 | 45 | class KTBulkImportManager { |
| 47 | 46 | var $oStorage; | ... | ... |
lib/subscriptions/subscriptions.inc.php
| ... | ... | @@ -97,11 +97,8 @@ class SubscriptionEvent { |
| 97 | 97 | * Every attempt is made to be as explicit as possible. |
| 98 | 98 | */ |
| 99 | 99 | |
| 100 | - /* | |
| 100 | + /** | |
| 101 | 101 | * Notification of bulk upload |
| 102 | - * Author : Jarrett Jordaan | |
| 103 | - * Date : 27/04/09 | |
| 104 | - * | |
| 105 | 102 | * @params : KTDocumentUtil $oDocObjects |
| 106 | 103 | * KTFolderUtil $oParentFolder |
| 107 | 104 | */ |
| ... | ... | @@ -115,11 +112,8 @@ class SubscriptionEvent { |
| 115 | 112 | } |
| 116 | 113 | } |
| 117 | 114 | |
| 118 | - /* | |
| 115 | + /** | |
| 119 | 116 | * Bulk upload email notification handler |
| 120 | - * Author : Jarrett Jordaan | |
| 121 | - * Date : 27/04/09 | |
| 122 | - * | |
| 123 | 117 | * @params : User $aUsers |
| 124 | 118 | * string $eventType |
| 125 | 119 | * KTDocumentUtil $oDocObjects | ... | ... |
lib/users/User.inc
| ... | ... | @@ -461,10 +461,8 @@ class User extends KTEntity { |
| 461 | 461 | return KTEntityUtil::getList2('User', $sWhereClause); |
| 462 | 462 | } |
| 463 | 463 | |
| 464 | - /* | |
| 465 | - * Modified : Jarrett Jordaan | |
| 466 | - * Added : Get new users | |
| 467 | - * Date : 24/04/09 | |
| 464 | + /** | |
| 465 | + * Get new users | |
| 468 | 466 | * |
| 469 | 467 | */ |
| 470 | 468 | function getByLastLoginNever() { |
| ... | ... | @@ -473,17 +471,9 @@ class User extends KTEntity { |
| 473 | 471 | return KTEntityUtil::getList2('User', $sWhereClause, $aOptions); |
| 474 | 472 | } |
| 475 | 473 | |
| 476 | - /* | |
| 477 | - * Modified : Jarrett Jordaan | |
| 478 | - * Added : Filter out disabled users | |
| 479 | - * Date : 24/04/09 | |
| 480 | - * Added : Removed disabled users Filter | |
| 481 | - * Date : 24/04/09 | |
| 482 | - */ | |
| 483 | 474 | function getByLastLoginAfter($dDateTime) { |
| 484 | 475 | return KTEntityUtil::getByDict('User', array( |
| 485 | 476 | 'last_login' => array('type' => 'after', 'value' => $dDateTime), |
| 486 | -// 'disabled' => 0, | |
| 487 | 477 | ), array('multi' => true)); |
| 488 | 478 | } |
| 489 | 479 | ... | ... |
lib/workflow/workflowtriggerinstance.inc.php
| ... | ... | @@ -72,8 +72,6 @@ class KTWorkflowTriggerInstance extends KTEntity { |
| 72 | 72 | function &get($iId) { return KTEntityUtil::get('KTWorkflowTriggerInstance', $iId); } |
| 73 | 73 | |
| 74 | 74 | function &createFromArray($aOptions) { |
| 75 | - // Modified : Jarrett Jordaan | |
| 76 | - // Removed Serialize, since the original is serialized already | |
| 77 | 75 | $aOptions['configarraytext'] = $aOptions['config']; |
| 78 | 76 | unset($aOptions['config']); |
| 79 | 77 | return KTEntityUtil::createFromArray('KTWorkflowTriggerInstance', $aOptions); | ... | ... |
setup/upgrade/steps/upgradeWelcome.php
| ... | ... | @@ -84,50 +84,37 @@ class upgradeWelcome extends step { |
| 84 | 84 | return true; |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | - private function checkPassword($username, $password) { | |
| 88 | - $upgradeOnly = false; | |
| 89 | - | |
| 90 | - if(isset($_POST['upgradeOnly'])) $upgradeOnly = $_POST['upgradeOnly']; | |
| 91 | - $dconf = $this->getDataFromPackage('installers', 'database'); // Use info from install | |
| 92 | - if($dconf) { // From Install | |
| 93 | - $this->util->dbUtilities->load($dconf['dhost'], $dconf['dport'], $dconf['duname'], $dconf['dpassword'], $dconf['dname']); | |
| 94 | - $sQuery = "SELECT count(*) AS match_count FROM users WHERE username = '$username' AND password = '".md5($password)."'"; | |
| 95 | - $res = $this->util->dbUtilities->query($sQuery); | |
| 96 | - $ass = $this->util->dbUtilities->fetchAssoc($res); | |
| 97 | - if($ass[0]['match_count'] == 1) | |
| 98 | - return true; | |
| 99 | - } elseif($upgradeOnly) { | |
| 100 | - require_once("../wizard/steps/configuration.php"); // configuration to read the ini path | |
| 101 | - $wizConfigHandler = new configuration(); | |
| 102 | - $configPath = $wizConfigHandler->readConfigPathIni(); | |
| 103 | - $this->util->iniUtilities->load($configPath); | |
| 104 | - $dconf = $this->util->iniUtilities->getSection('db'); | |
| 105 | - $this->util->dbUtilities->load($dconf['dbHost'],$dconf['dbPort'], $dconf['dbUser'], $dconf['dbPass'], $dconf['dbName']); | |
| 106 | - $sQuery = "SELECT count(*) AS match_count FROM users WHERE username = '$username' AND password = '".md5($password)."'"; | |
| 87 | + private function checkPassword($username, $password) { | |
| 88 | + $dconf = $this->getDataFromPackage('installers', 'database'); // Use info from install | |
| 89 | + if($dconf) { // From Install | |
| 90 | + $this->util->dbUtilities->load($dconf['dhost'], $dconf['dport'], $dconf['duname'], $dconf['dpassword'], $dconf['dname']); | |
| 91 | + } else { // Upgrade | |
| 92 | + require_once("../wizard/steps/configuration.php"); // configuration to read the ini path | |
| 93 | + $wizConfigHandler = new configuration(); | |
| 94 | + $configPath = $wizConfigHandler->readConfigPathIni(); | |
| 95 | + if($configPath) { | |
| 96 | + $this->util->iniUtilities->load($configPath); | |
| 97 | + $dconf = $this->util->iniUtilities->getSection('db'); | |
| 98 | + $this->util->dbUtilities->load($dconf['dbHost'],$dconf['dbPort'], $dconf['dbUser'], $dconf['dbPass'], $dconf['dbName']); | |
| 99 | + } | |
| 100 | + } | |
| 101 | + $sQuery = "SELECT * FROM users WHERE username = '$username' AND password = '".md5($password)."'"; | |
| 102 | + $res = $this->util->dbUtilities->query($sQuery); | |
| 103 | + $ass = $this->util->dbUtilities->fetchAssoc($res); | |
| 104 | + if($ass[0]['id'] != "") { | |
| 105 | + $user_id = $ass[0]['id']; | |
| 106 | + $sQuery = "SELECT count(*) AS match_count FROM users_groups_link WHERE user_id = $user_id AND group_id = 1"; | |
| 107 | 107 | $res = $this->util->dbUtilities->query($sQuery); |
| 108 | 108 | $ass = $this->util->dbUtilities->fetchAssoc($res); |
| 109 | - if($ass[0]['match_count'] == 1) | |
| 109 | + if($ass[0]['match_count'] == 1) | |
| 110 | 110 | return true; |
| 111 | - } else { // Upgrade | |
| 112 | - require_once("../wizard/steps/configuration.php"); // configuration to read the ini path | |
| 113 | - $wizConfigHandler = new configuration(); | |
| 114 | - $configPath = $wizConfigHandler->readConfigPathIni(); | |
| 115 | - if($configPath) { | |
| 116 | - $this->util->iniUtilities->load($configPath); | |
| 117 | - $dconf = $this->util->iniUtilities->getSection('db'); | |
| 118 | - $this->util->dbUtilities->load($dconf['dbHost'],$dconf['dbPort'], $dconf['dbUser'], $dconf['dbPass'], $dconf['dbName']); | |
| 119 | - $sQuery = "SELECT count(*) AS match_count FROM users WHERE username = '$username' AND password = '".md5($password)."'"; | |
| 120 | - $res = $this->util->dbUtilities->query($sQuery); | |
| 121 | - $ass = $this->util->dbUtilities->fetchAssoc($res); | |
| 122 | - if($ass[0]['match_count'] == 1) | |
| 123 | - return true; | |
| 124 | - } | |
| 125 | - } | |
| 126 | - $this->error[] = 'Could Not Authenticate User'; | |
| 127 | - return false; | |
| 128 | - | |
| 129 | - } | |
| 130 | - | |
| 111 | + $this->error[] = 'You need Administrative Rights'; | |
| 112 | + return false; | |
| 113 | + } | |
| 114 | + $this->error[] = 'Could Not Authenticate User'; | |
| 115 | + return false; | |
| 116 | + } | |
| 117 | + | |
| 131 | 118 | public function getErrors() { |
| 132 | 119 | return $this->error; |
| 133 | 120 | } | ... | ... |
setup/upgrade/templates/welcome.tpl
| ... | ... | @@ -11,7 +11,7 @@ |
| 11 | 11 | <table> |
| 12 | 12 | <tr><td>Username</td><td><input id="username" name=username></td></tr> |
| 13 | 13 | <tr><td>Password</td><td><input name=password type="password"></td></tr> |
| 14 | - <?php if (!empty($errors)) { ?><tr><td></td><td><span class="error">Could Not Authenticate User</span></td></tr> <?php } ?> | |
| 14 | + <?php if (!empty($errors)) { ?><tr><td></td><td><span class="error"><?php echo $errors[0]; ?></span></td></tr> <?php } ?> | |
| 15 | 15 | </table> |
| 16 | 16 | |
| 17 | 17 | </div> |
| ... | ... | @@ -30,4 +30,4 @@ |
| 30 | 30 | <script type="text/javascript"> |
| 31 | 31 | $('#username').focus(); |
| 32 | 32 | </script> |
| 33 | -<?php if (AJAX) { echo $html->js('form.js'); } ?> | |
| 34 | 33 | \ No newline at end of file |
| 34 | +<?php if (AJAX) { echo $html->js('form.js'); } ?> | ... | ... |