[geeklog-hg] geeklog: Added user.config.php ignored by .hgignore
geeklog-cvs at lists.geeklog.net
geeklog-cvs at lists.geeklog.net
Tue Oct 27 18:49:18 EDT 2015
changeset 9641:2dc626d7f1b2
url: http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/2dc626d7f1b2
user: Kenji ITO <mystralkk at gmail.com>
date: Wed Oct 28 07:44:35 2015 +0900
description:
Added user.config.php ignored by .hgignore
diffstat:
.hgignore | 2 +-
public_html/filemanager/connectors/php/user.config.php | 50 ++++++++++++++++++
2 files changed, 51 insertions(+), 1 deletions(-)
diffs (67 lines):
diff -r 7f234aa6d0a0 -r 2dc626d7f1b2 .hgignore
--- a/.hgignore Mon Oct 26 16:25:11 2015 +0900
+++ b/.hgignore Wed Oct 28 07:44:35 2015 +0900
@@ -46,7 +46,7 @@
# test framework, if present
public_html/tests
-config.php
+^config.php
plugins/calendar/config.php
plugins/links/config.php
plugins/polls/config.php
diff -r 7f234aa6d0a0 -r 2dc626d7f1b2 public_html/filemanager/connectors/php/user.config.php
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/public_html/filemanager/connectors/php/user.config.php Wed Oct 28 07:44:35 2015 +0900
@@ -0,0 +1,50 @@
+<?php
+/**
+ * Filemanager PHP connector
+ * This file should at least declare auth() function
+ * and instantiate the Filemanager as '$fm'
+ *
+ * IMPORTANT : by default Read and Write access is granted to everyone
+ * Copy/paste this file to 'user.config.php' file to implement your own auth() function
+ * to grant access to wanted users only
+ *
+ * filemanager.php
+ * use for ckeditor filemanager
+ *
+ * @license MIT License
+ * @author Simon Georget <simon (at) linea21 (dot) com>
+ * @copyright Authors
+ */
+
+require_once dirname(__FILE__) . '/../../../lib-common.php';
+
+/**
+ * Check if user is authorized
+ *
+ *
+ * @return boolean true if access granted, false if no access
+ */
+function auth() {
+ // You can insert your own code over here to check if the user is authorized.
+ // If you use a session variable, you've got to start the session first (session_start())
+ global $_CONF;
+
+ return SEC_inGroup('Root') || (!$_CONF['filemanager_disabled'] && (SEC_inGroup('Filemanager Admin') || SEC_hasRights('filemanager.admin')));
+}
+
+// @todo Work on plugins registration
+// if (isset($config['plugin']) && !empty($config['plugin'])) {
+// $pluginPath = 'plugins' . DIRECTORY_SEPARATOR . $config['plugin'] . DIRECTORY_SEPARATOR;
+// require_once($pluginPath . 'filemanager.' . $config['plugin'] . '.config.php');
+// require_once($pluginPath . 'filemanager.' . $config['plugin'] . '.class.php');
+// $className = 'Filemanager'.strtoupper($config['plugin']);
+// $fm = new $className($config);
+// } else {
+// $fm = new Filemanager($config);
+// }
+
+
+// we instantiate the Filemanager
+$fm = new Filemanager();
+
+?>
\ No newline at end of file
More information about the geeklog-cvs
mailing list