-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
92 changed files
with
16,230 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
OBM II | ||
|
||
|
||
TO DO | ||
|
||
• mobile layout is still pretty messed up | ||
|
||
• loading.gif shows twice on screen - once in the main section and once in the folders section - why? | ||
|
||
• $this->foreign_username appears to be empty in print_tree() in folders.php | ||
The folders menu shows the "user's Bookmarks" but once you navigate, it changes to "My Bookmarks" and the icons change color. | ||
|
||
? the object orientation seems half-baked. Some files are classes but others aren't. | ||
|
||
• add password update in admin | ||
|
||
• make each column scroll independently from each other. | ||
|
||
|
||
|
||
DONE | ||
|
||
√ updated to work with PHP 8.0+ | ||
|
||
√ added simplehtmldom to cover all cases of favicon paths. | ||
|
||
√ fixed favicon.php | ||
√ Refresh Icon button now works | ||
√ Delete Favicons button now works | ||
|
||
√ updated mysql to mysqli | ||
|
||
√ general code cleanup, consistency |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
https://github.com/s22-tech/openbookmark | ||
|
||
|
||
See http://www.frech.ch/openbookmark/installation.php for installation instructions. | ||
|
||
If you are upgrading from an old version, please manually create the following column on the `user` table: | ||
theme varchar(50) NOT NULL default '' | ||
|
||
|
||
|
||
------ | ||
|
||
|
||
|
||
New Installation: | ||
|
||
Basically the installation of OpenBookmark is not a big deal. There is an install script that guides you through the install steps. Just make sure you know your servers database credentials. | ||
|
||
Download: First of all, download the latest Version of OpenBookmark and unpack the tarball in your Webserver's DocumentRoot direcotry. | ||
Installation: Now point your browser to the freshly created directory on your webserver. If you did it well, the URL might look like this: | ||
|
||
http://www.yourserver.com/openbookmark/ | ||
|
||
If the configuration file "./config/config.php" is missing - and it most probably will be if you are installing a new version - then a page will be shown linking to the install script. After answering all the questions in the install script, a config section is being displayed. Copy the section and paste it to "./config/config.php". The section looks like this. After creating the config file you must delete the install.php file prior visiting OpenBookmark, just for security reasons. | ||
|
||
Login: Try visiting http://www.yourserver.com/openbookmark/ and login using the user that the install script created for you. The username and password is "admin". The first thing you should do is changing the password. Then open the admin script and start creating other users. You can find the admin script under the menu option "Tools". | ||
|
||
|
||
Upgrade an existing Installation: | ||
|
||
If you have an already existing installation of OpenBookmark and you would like to upgrade, the install script will care about the needed steps. If you are wise, you will backup the working installation before using the new one: | ||
|
||
Backup files: I simply rename or move the old installation of OpenBookmark so that the new version can take place: | ||
|
||
# mv /path/to/openbookmark \ | ||
/path/to/openbookmark-backup | ||
|
||
Backup the database: Then I backup the database content by feeding this command to the MySQL server: | ||
|
||
# mysqldump --user=bookmarkmgr \ | ||
--password=password_of_bookmarkmgr \ | ||
bookmarks \ | ||
> /some/path/openbookmark-backup.sql | ||
|
||
Upgrade: Now proceed with the steps from the description above. Don't forget to copy the favicons to the new directory: | ||
|
||
# cp -a /path/to/openbookmark-backup/icons/* \ | ||
/path/to/openbookmark/icons/ | ||
|
||
Admin user: If you upgraded and using at least version 0.8.7_beta now, the new admin script will be available. However, it will only be accessible by admin users. Thus you have to define one ore more users as admins now. To do so login to your MySQL server and do the following change in your database: | ||
|
||
# mysql -p bookmarks | ||
Enter password: | ||
... | ||
mysql> UPDATE user SET admin='1' WHERE username='some_user'; | ||
|
||
|
||
Install favicon support: | ||
|
||
Since version 0.6.4 there is a nice feature with OpenBookmark that allows you to display the favicon of a webpage if one exists. To make this work, do the following steps: | ||
|
||
Make sure ImageMagick is installed on your server. This is used to convert the favicon to PNG, since some browsers cannot display ICO files. | ||
|
||
Edit the "./config/config.php" file and set the variables $convert and $identify to where the "convert" and "identify" executables are on your system. It might be something like "/usr/local/bin/convert" or "/usr/bin/convert". | ||
|
||
Make sure that the "./favicons" directory is writable, readable and executable by the user your webserver runs as. Just chmod it to 755 and it will be. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,236 @@ | ||
<?php | ||
require_once($_SERVER['DOCUMENT_ROOT'] . '/header.php'); | ||
logged_in_only(); | ||
|
||
$delete = set_post_string_var('delete'); | ||
$create = set_post_string_var('create'); | ||
$new_username = set_post_string_var('new_username'); | ||
$new_password = set_post_string_var('new_password'); | ||
$new_admin = set_post_bool_var('new_admin', false); | ||
$existing_user = set_post_string_var('existing_user'); | ||
$noconfirm = set_get_noconfirm(); | ||
|
||
$message1 = ''; | ||
$message2 = ''; | ||
?> | ||
|
||
<h1 id="caption"> Admin Page </h1> | ||
|
||
<!-- Wrapper starts here. --> | ||
<div style="min-width: <?php echo 230 + $settings['column_width_folder']; ?>px;"> | ||
<!-- Menu starts here. --> | ||
<div id="menu"> | ||
<h2 class="nav"> Bookmarks </h2> | ||
<ul class="nav"> | ||
<li><a href="./index.php"> My Bookmarks </a></li> | ||
<li><a href="./shared.php"> Shared Bookmarks </a></li> | ||
</ul> | ||
|
||
<h2 class="nav">Tools</h2> | ||
<ul class="nav"> | ||
<?php if (admin_only()) { ?> | ||
<li><a href="./admin.php"> Admin </a></li> | ||
<?php } ?> | ||
<li><a href="./import.php"> Import </a></li> | ||
<li><a href="./export.php"> Export </a></li> | ||
<li><a href="./sidebar.php"> View as Sidebar </a></li> | ||
<li><a href="./settings.php"> Settings </a></li> | ||
<li><a href="./index.php?logout=1"> Logout </a></li> | ||
</ul> | ||
<!-- Menu ends here. --> | ||
</div> | ||
|
||
<!-- Main content starts here. --> | ||
<div id="main"> | ||
|
||
<?php | ||
if (!admin_only()) { | ||
message('You are not an Admin.'); | ||
} | ||
|
||
if ($create == 'Create') { | ||
if ($new_username == '' || $new_password == '') { | ||
$message1 = 'Username and Password fields must not be empty.'; | ||
} | ||
else if (check_username($new_username)) { | ||
$message1 = 'User already exists.'; | ||
} | ||
else { | ||
$query = sprintf(" | ||
INSERT INTO `obm_users` (`username`, `password`, `admin`) | ||
VALUES ('%s', md5('%s'), '%d')", | ||
$mysql->escape($new_username), | ||
$mysql->escape($new_password), | ||
$mysql->escape($new_admin) | ||
); | ||
|
||
if ($mysql->query($query)) { | ||
$message1 = "User $new_username created."; | ||
} | ||
else { | ||
message($mysql->error); | ||
} | ||
unset ($new_password, $_POST['new_password']); | ||
} | ||
} | ||
?> | ||
|
||
<div style="border: 1px solid #bbb; margin: 10px; padding: 10px;"> | ||
<h2 class="caption">Create User</h2> | ||
|
||
<form action="<?php echo $_SERVER['SCRIPT_NAME']; ?>" method="post"> | ||
<table> | ||
<tr> | ||
<td>Username: | ||
</td> | ||
<td> | ||
<input type="text" name="new_username"> | ||
</td> | ||
</tr> | ||
|
||
<tr> | ||
<td>Password: | ||
</td> | ||
<td> | ||
<input type="password" name="new_password"> | ||
</td> | ||
</tr> | ||
|
||
<tr> | ||
<td>Admin: | ||
</td> | ||
<td> | ||
<input type="checkbox" name="new_admin" value="1"> | ||
</td> | ||
</tr> | ||
|
||
<tr> | ||
<td> | ||
</td> | ||
<td> | ||
<input type="submit" name="create" value="Create"> <?php echo $message1; ?> | ||
</td> | ||
</tr> | ||
</table> | ||
</form> | ||
|
||
</div> | ||
|
||
<div style="border: 1px solid #bbb; margin: 10px; padding: 10px;"> | ||
<h2 class="caption">Delete User</h2> | ||
|
||
<?php | ||
if ($delete == 'Delete') { | ||
if (check_username ($existing_user)) { | ||
if ($noconfirm) { | ||
$query = sprintf(" | ||
DELETE FROM `obm_users` | ||
WHERE md5(username)=md5('%s')", | ||
$mysql->escape($existing_user) | ||
); | ||
if ($mysql->query($query)) { | ||
$message2 = 'User $existing_user deleted.<br>'; | ||
} | ||
else { | ||
message($mysql->error); | ||
} | ||
|
||
$query = sprintf(" | ||
DELETE FROM `obm_bookmarks` | ||
WHERE md5(user)=md5('%s')", | ||
$mysql->escape($existing_user) | ||
); | ||
if (!$mysql->query($query)) { | ||
message($mysql->error); | ||
} | ||
|
||
$query = sprintf(" | ||
DELETE FROM `obm_folders` | ||
WHERE md5(user)=md5('%s')", | ||
$mysql->escape($existing_user) | ||
); | ||
if (!$mysql->query($query)) { | ||
message($mysql->error); | ||
} | ||
list_users(); | ||
} | ||
else { | ||
?> | ||
|
||
<p>Are you sure you want to delete the user <?php echo $existing_user; ?> and all their Bookmarks and Folders?</p> | ||
<form action="<?php echo $_SERVER['SCRIPT_NAME'] . "?noconfirm=1"; ?>" method="post" name="userdelete"> | ||
<input type="hidden" name="existing_user" value="<?php echo $existing_user; ?>"> | ||
<input type="submit" name="delete" value="Delete"> | ||
<input type="button" value=" Cancel " onClick="self.location.href='./admin.php'"> | ||
</form> | ||
|
||
<?php | ||
} | ||
} | ||
else { | ||
$message2 = 'User does not exist.'; | ||
list_users(); | ||
} | ||
} | ||
else { | ||
list_users(); | ||
} | ||
|
||
function list_users () { | ||
global $mysql, $message2; | ||
?> | ||
|
||
<form action="<?php echo $_SERVER['SCRIPT_NAME']; ?>" method="post"> | ||
<div style="height:200px; width:300px; overflow:auto;"> | ||
<?php | ||
$query = "SELECT `username`, `admin` FROM `obm_users` ORDER BY `username`"; | ||
|
||
if ($mysql->query($query)) { | ||
while ($row = mysqli_fetch_object($mysql->result)) { | ||
echo '<input type="radio" name="existing_user" value="'.$row->username.'">'; | ||
if ($row->admin) { | ||
echo ' <b>' . $row->username . "</b><br>\n"; | ||
} | ||
else { | ||
echo ' ' . $row->username . "<br>\n"; | ||
} | ||
} | ||
} | ||
else { | ||
message($mysql->error); | ||
} | ||
?> | ||
</div> | ||
<input type="submit" name="delete" value="Delete"> | ||
<?php echo $message2; ?> | ||
|
||
</form> | ||
|
||
<?php | ||
} | ||
?> | ||
|
||
</div> | ||
|
||
<div style="border: 1px solid #bbb; margin: 10px; padding: 10px;"> | ||
<h2 class="caption"> Version </h2> | ||
|
||
<table> | ||
<tr> | ||
<td>This Version:</td> | ||
<td><?php echo get_version(); ?></td> | ||
</tr> | ||
|
||
<tr> | ||
<td><a href="https://github.com/s22-tech?tab=repositories" target="_new"> Latest version: </a></td> | ||
<td><a href="https://github.com/s22-tech?tab=repositories" target="_new"><?php check_for_new_version(); ?></a></td> | ||
</tr> | ||
</table> | ||
|
||
</div> | ||
</div> | ||
|
||
<?php | ||
print_footer(); | ||
require_once ($_SERVER['DOCUMENT_ROOT'] . '/footer.php'); | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
define ('ABSOLUTE_PATH', dirname (__FILE__) . '/'); | ||
|
||
if (extension_loaded('zlib')) { | ||
ob_end_clean(); | ||
ob_start('ob_gzhandler'); | ||
} | ||
|
||
require_once (ABSOLUTE_PATH . 'lib/webstart.php'); | ||
if (! is_file (ABSOLUTE_PATH . 'config/config.php')) { | ||
die ('You have to <a href="./install.php">install</a> OpenBookmark.'); | ||
} | ||
else { | ||
require_once (ABSOLUTE_PATH . 'config/config.php'); | ||
} | ||
require_once (ABSOLUTE_PATH . 'lib/mysql.php'); | ||
$mysql = new mysql; | ||
|
||
require_once (ABSOLUTE_PATH . 'lib/auth.php'); | ||
$auth = new Auth; | ||
|
||
require_once (ABSOLUTE_PATH . 'lib/lib.php'); | ||
require_once (ABSOLUTE_PATH . 'lib/login.php'); | ||
|
||
//if (is_file (ABSOLUTE_PATH . 'install.php')) { | ||
// message ('Remove "install.php" before using OpenBookmark.'); | ||
//} | ||
|
||
if ($display_login_form) { | ||
$auth->display_login_form(); | ||
require_once (ABSOLUTE_PATH . 'footer.php'); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<?php | ||
include($_SERVER['DOCUMENT_ROOT'] . '/bookmarks/new_bookmark.php'); |
Oops, something went wrong.