Skip to content

Commit

Permalink
Merge branch 'release/1.3.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenlawrence committed Jan 10, 2015
2 parents 275fd3b + 349962a commit 080f777
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 39 deletions.
8 changes: 4 additions & 4 deletions Dept_Perms_class.php
Original file line number Diff line number Diff line change
Expand Up @@ -270,11 +270,11 @@ function isForbidden($data_id)
':data_id' => $data_id,
':id' => $this->id
));
$result = $stmt->fetchAll();
$result = $stmt->fetch();

if($stmt->rowCount() == 1)
{
if($result['right'] == $this->FORBIDDEN_RIGHT)
if($result['rights'] == $this->FORBIDDEN_RIGHT)
{
return true;
}
Expand Down Expand Up @@ -353,12 +353,12 @@ function getPermission($data_id)
':data_id' => $data_id,
':id' => $this->id
));
$results = $stmt->fetchAll();
$results = $stmt->fetch();

$num_results = $stmt->rowCount();
if($num_results == 1)
{
$permission = $results['right'];
$permission = $results['rights'];
return $permission;
}
else if ($num_results == 0)
Expand Down
6 changes: 3 additions & 3 deletions add.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,11 @@ function is invoked. After the data is loaded for the chosen department, if the

display_smarty_template('add.tpl');

udf_add_file_form();

// Call the plugin API
callPluginMethod('onBeforeAdd');

udf_add_file_form();


display_smarty_template('_add_footer.tpl');

}
Expand Down
3 changes: 2 additions & 1 deletion database.sql
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ CREATE TABLE odm_user (
# Dumping data for table 'odm_user'
#

INSERT INTO odm_user VALUES (NULL,'admin','',1,'5555551212','admin@example.com','User','Admin','', 1, 1);
INSERT INTO odm_user VALUES (NULL,'admin',md5('admin'),1,'5555551212','admin@mailinator.com','User','Admin','', 1, 1);

#
# Table structure for table 'odm_user_perms'
Expand Down Expand Up @@ -290,6 +290,7 @@ INSERT INTO `odm_filetypes` VALUES(NULL, 'text/richtxt', 1);
INSERT INTO `odm_filetypes` VALUES(NULL, 'application/mspowerpoint', 1);
INSERT INTO `odm_filetypes` VALUES(NULL, 'application/octet-stream', 1);
INSERT INTO `odm_filetypes` VALUES(NULL, 'application/x-zip-compressed', 1);
INSERT INTO `odm_filetypes` VALUES(NULL, 'application/x-zip', 1);
INSERT INTO `odm_filetypes` VALUES(NULL, 'application/zip', 1);
INSERT INTO `odm_filetypes` VALUES(NULL, 'image/tiff', 1);
INSERT INTO `odm_filetypes` VALUES(NUll, 'image/tif', 1);
Expand Down
7 changes: 4 additions & 3 deletions edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,6 @@
$avail_user_perms['rights'] = $user_perms_obj->getPermissionForUser($user['id'], $data_id);
array_push($user_perms_array, $avail_user_perms);
}

// Call Plugin API
callPluginMethod('onBeforeEditFile', $data_id);

$GLOBALS['smarty']->assign('file_id', $filedata->getId());
$GLOBALS['smarty']->assign('realname', $filedata->name);
Expand All @@ -159,6 +156,10 @@

display_smarty_template('edit.tpl');
udf_edit_file_form();

// Call Plugin API
callPluginMethod('onBeforeEditFile', $data_id);

display_smarty_template('_edit_footer.tpl');
}//end else
} else {
Expand Down
11 changes: 6 additions & 5 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@
':frmuser' => $frmuser,
':frmpass' => $frmpass
));
$result = $stmt->fetch();
$result = $stmt->fetchAll();

if($stmt->rowCount() != 1)
if(count($result) != 1)
{
// Check old password() method
$query = "
Expand All @@ -120,13 +120,14 @@
':frmuser' => $frmuser,
':frmpass' => $frmpass
));
$result = $stmt->fetchAll();
}

// if row exists - login/pass is correct
if ($stmt->rowCount() == 1)
if (count($result) == 1)
{
// register the user's ID
$id = $result['id'];
$id = $result[0]['id'];
$username = $result['username'];
$password = $result['password'];

Expand Down Expand Up @@ -169,4 +170,4 @@
{
echo 'Check your config';
}
draw_footer();
draw_footer();
47 changes: 26 additions & 21 deletions install/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -434,40 +434,45 @@ function do_update_1263()
include("upgrade_1263.php");
echo 'All Done with update! Click <a href="../index.php">HERE</a> to login<br>';
}
function do_update_128()
{
echo 'Updating from DB versions 1.2.8...<br />';
include("../config.php");
include("upgrade_128.php");
echo 'All Done with update! Click <a href="../index.php">HERE</a> to login<br>';
}
function do_update_128()
{
echo 'Updating from DB versions 1.2.8...<br />';
include("../config.php");
include("upgrade_128.php");
echo 'All Done with update! Click <a href="../index.php">HERE</a> to login<br>';
}

function do_update_129()
{
echo 'Updating from DB versions 1.2.9...<br />';
include("../config.php");
include("upgrade_129.php");
echo 'All Done with update! Click <a href="../index.php">HERE</a> to login<br>';
}
{
echo 'Updating from DB versions 1.2.9...<br />';
include("../config.php");
include("upgrade_129.php");
echo 'All Done with update! Click <a href="../index.php">HERE</a> to login<br>';
}

function print_intro()
{
global $pdo;
include_once('../version.php');

$query1 = "SHOW TABLES LIKE :table";
$stmt = $pdo->prepare($query1);
$stmt->execute(array(':table' => $_SESSION['db_prefix'] . 'odmsys'));

if($stmt->rowCount() > 0) {
$query = "SHOW TABLES LIKE :table";
$stmt = $pdo->prepare($query);
$stmt->execute(array(
":table" => $_SESSION['db_prefix'] . 'odmsys'
));
$result = $stmt->fetchAll();

if (count($result) == 0) {
$db_version = 'Unknown';
} else {
// Ok, db is there. Lets check the db version now
$query2 = "SELECT sys_value from {$_SESSION['db_prefix']}odmsys WHERE sys_name='version'";
$stmt = $pdo->prepare($query2);
$stmt->execute();
$result_array = $stmt->fetch();
$db_version = (!empty($result_array['sys_value']) ? $result_array['sys_value'] : 'Unknown');
}
$db_version = (!empty($result_array['sys_value']) ? $result_array['sys_value'] : 'Unknown');
//print_r($current_db_version);exit;
?>
?>
<h3>Welcome to the OpenDocMan Database Installer/Updater Tool</h3>
</div>
<hr>
Expand Down
1 change: 1 addition & 0 deletions templates/common/_edit_footer.tpl
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<tr>
<td colspan="4" align="center"><div class="buttons"><button class="positive" type="Submit" name="submit" value="Update Document Properties">{$g_lang_button_save}</button></div></td>
<td colspan="4" align="center"><div class="buttons"><button class="negative" type="Reset" name="reset" value="Reset">{$g_lang_button_reset}</button></div></td>

Expand Down
4 changes: 2 additions & 2 deletions version.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/*
version.php - OpenDocMan version information
Copyright (C) 2007-2014 Stephen Lawrence Jr.
Copyright (C) 2007-2015 Stephen Lawrence Jr.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
Expand All @@ -18,4 +18,4 @@
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/

$GLOBALS['CONFIG']['current_version'] = '1.3.0';
$GLOBALS['CONFIG']['current_version'] = '1.3.1';

0 comments on commit 080f777

Please sign in to comment.