Skip to content

Commit

Permalink
Merge branch 'master' of github.com:slims/slims7_cendana
Browse files Browse the repository at this point in the history
  • Loading branch information
buitenzorg812 committed Jun 7, 2016
2 parents b1c7cdb + 401a35f commit 8087804
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 24 deletions.
49 changes: 26 additions & 23 deletions admin/default/home.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,39 +77,42 @@
$warnings[] = __('Installer folder is still exist inside your server. Please remove it or rename to another name for security reason.');
}

if ($_SESSION['uid'] === '1') {
$warnings[] = __('<strong><i>You are logged in as Super User. With great power comes great responsibility.</i></strong>');
// check need to be repaired mysql database
$query_of_tables = $dbs->query('SHOW TABLES');
$num_of_tables = $query_of_tables->num_rows;
$prevtable = '';
$is_repaired = false;

// check need to be repaired mysql database
$query_of_tables = $dbs->query('SHOW TABLES');
$num_of_tables = $query_of_tables->num_rows;
$prevtable = '';
$is_repaired = false;

if (isset ($_POST['do_repair'])) {
if (isset ($_POST['do_repair'])) {
if ($_POST['do_repair'] == 1) {
while ($row = $query_of_tables->fetch_row()) {
$sql_of_repair = 'REPAIR TABLE '.$row[0];
$query_of_repair = $dbs->query ($sql_of_repair);
}
while ($row = $query_of_tables->fetch_row()) {
$sql_of_repair = 'REPAIR TABLE '.$row[0];
$query_of_repair = $dbs->query ($sql_of_repair);
}
}
}
}

while ($row = $query_of_tables->fetch_row()) {
while ($row = $query_of_tables->fetch_row()) {
$query_of_check = $dbs->query('CHECK TABLE '.$row[0]);
while ($rowcheck = $query_of_check->fetch_assoc()) {
if (!(($rowcheck['Msg_type'] == "status") && ($rowcheck['Msg_text'] == "OK"))) {
if ($row[0] != $prevtable) {
echo '<li class="warning">Table '.$row[0].' might need to be repaired.</li>';
}
$prevtable = $row[0];
$is_repaired = true;
if (!(($rowcheck['Msg_type'] == "status") && ($rowcheck['Msg_text'] == "OK"))) {
if ($row[0] != $prevtable) {
echo '<li class="warning">Table '.$row[0].' might need to be repaired.</li>';
}
$prevtable = $row[0];
$is_repaired = true;
}
}
}
if (($is_repaired) && !isset($_POST['do_repair'])) {
echo '<li class="warning"><form method="POST"><input type="hidden" name="do_repair" value="1"><input value="Repair Tables" type="submit"></form></li>';
}
}
if (($is_repaired) && !isset($_POST['do_repair'])) {
echo '<li class="warning"><form method="POST"><input type="hidden" name="do_repair" value="1"><input value="Repaire Tables" type="submit"></form></li>';
}

// if there any warnings

// if there are any warnings
if ($warnings) {
echo '<div class="message">';
echo '<ul>';
Expand Down
1 change: 1 addition & 0 deletions admin/modules/bibliography/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@

$class = str_ireplace('NEW:', '', trim(strip_tags($_POST['class'])));
$data['classification'] = trim($dbs->escape_string(strip_tags($class)));
$data['uid'] = $_SESSION['uid'];

// check publisher
// echo stripos($_POST['publisherID'], 'NEW:');
Expand Down
2 changes: 2 additions & 0 deletions install/senayan.sql
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,12 @@ CREATE TABLE IF NOT EXISTS `biblio` (
`spec_detail_info` text collate utf8_unicode_ci,
`input_date` datetime default NULL,
`last_update` datetime default NULL,
`uid` int(11) default NULL,
PRIMARY KEY (`biblio_id`),
KEY `references_idx` (`gmd_id`,`publisher_id`,`language_id`,`publish_place_id`),
KEY `classification` (`classification`),
KEY `biblio_flag_idx` (`opac_hide`,`promoted`),
KEY `uid` (`uid`),
FULLTEXT KEY `title_ft_idx` (`title`,`series_title`),
FULLTEXT KEY `notes_ft_idx` (`notes`),
FULLTEXT KEY `labels` (`labels`)
Expand Down
2 changes: 2 additions & 0 deletions install/senayan.sql.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,12 @@
`spec_detail_info` text collate utf8_unicode_ci,
`input_date` datetime default NULL,
`last_update` datetime default NULL,
`uid` int(11) default NULL,
PRIMARY KEY (`biblio_id`),
KEY `references_idx` (`gmd_id`,`publisher_id`,`language_id`,`publish_place_id`),
KEY `classification` (`classification`),
KEY `biblio_flag_idx` (`opac_hide`,`promoted`),
KEY `uid` (`uid`),
FULLTEXT KEY `title_ft_idx` (`title`,`series_title`),
FULLTEXT KEY `notes_ft_idx` (`notes`),
FULLTEXT KEY `labels` (`labels`)
Expand Down
2 changes: 1 addition & 1 deletion lib/contents/visitor.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
$photo = 'person.png';
$expire = 0;
// sleep for a while
sleep(2);
sleep(0);
/**
* Insert counter data to database
*/
Expand Down
2 changes: 2 additions & 0 deletions upgrade/upgrade_slims7_cendana_x.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE `biblio` ADD `uid` INT( 11 ) NULL DEFAULT NULL ,
ADD INDEX ( `uid` ) ;

0 comments on commit 8087804

Please sign in to comment.