本文整理汇总了PHP中isForAdminOnly函数的典型用法代码示例。如果您正苦于以下问题:PHP isForAdminOnly函数的具体用法?PHP isForAdminOnly怎么用?PHP isForAdminOnly使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了isForAdminOnly函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dirname
/**
* manageUsers.php
* users listing
*
* @version 2011.0510
* @autor: Artem Osmakov
*
* @copyright (C) 2005-2010 University of Sydney Digital Innovation Unit.
* @link: http://HeuristScholar.org
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @package Heurist academic knowledge management system
* @todo
**/
require_once dirname(__FILE__) . '/../../common/connect/applyCredentials.php';
if (!array_key_exists('grpID', $_REQUEST)) {
if (isForAdminOnly("to add or change users")) {
return;
}
}
$isPopup = array_key_exists('popup', $_REQUEST) && $_REQUEST['popup'] == "yes";
?>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Manage Users</title>
<link rel=stylesheet href="../../common/css/global.css">
<link rel="stylesheet" type="text/css" href="../../external/yui/2.8.2r1/build/container/assets/skins/sam/container.css">
示例2: dirname
* See the License for the specific language governing permissions and limitations under the License.
*/
/*
Cloning workflow:
1. Create empty database with blankDBStructure.sql
2. Empty sysIdentification, sysTableLastUpdated, sysUsrGrpLinks, sysUGrps, defLanguages
3. Copy ALL tables
4. reset reginfo
5. Create indexes and procedures
6. Copy db folder and update file path in recUploadedFiles
*/
require_once dirname(__FILE__) . '/../../../common/connect/applyCredentials.php';
require_once dirname(__FILE__) . '/../../../records/index/elasticSearchFunctions.php';
require_once dirname(__FILE__) . '/../../../common/php/dbUtils.php';
require_once dirname(__FILE__) . '/../../../hserver/dbaccess/utils_db_load_script.php';
if (isForAdminOnly("to clone a database")) {
return;
}
mysql_connection_overwrite(DATABASE);
if (mysql_error()) {
die("<h2>Error</h2>Sorry, could not connect to the database (mysql_connection_overwrite error)");
}
?>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Clone Database</title>
<link rel="stylesheet" type="text/css" href="../../../common/css/global.css">
<link rel="stylesheet" type="text/css" href="../../../common/css/edit.css">
示例3: define
*/
/**
* removeDatabaseLocks.php, Removes all locks on the database. Ian Johnson 20/9/12
* We can get away with no checkiong b/c locks are administrative and collisons are almost inconceivable
* @copyright (C) 2005-2010 University of Sydney Digital Innovation Unit.
* @link: http://HeuristScholar.org
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @package Heurist academic knowledge management system
* @todo
**/
define('dirname(__FILE__)', dirname(__FILE__));
// this line can be removed on new versions of PHP as dirname(__FILE__) is a magic constant
/* require_once(dirname(__FILE__)."/../../common/config/initialise.php"); */
require_once dirname(__FILE__) . '/../../common/connect/applyCredentials.php';
require_once dirname(__FILE__) . '/../../common/php/dbMySqlWrappers.php';
if (isForAdminOnly("to perform this action")) {
return;
}
mysql_connection_overwrite(DATABASE);
$query = "delete from sysLocks";
$res = mysql_query($query);
if (!$res) {
die('<p>Invalid query, please report to developers: ' . $query . ' Error: ' . mysql_error());
}
if (mysql_affected_rows() == 0) {
print "<html><head><link rel=stylesheet href='../../common/css/global.css'></head><body class='popup'>\n <h2> There were no database locks to remove</h2>";
} else {
print "<html><head><link rel=stylesheet href='../../common/css/global.css'></head><body class='popup'>\n <h2>Database locks have been removed </h2>";
}
print "</body>";
print "</html>";
示例4: dirname
* @version 3.1.0
*/
/*
* Licensed under the GNU License, Version 3.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at http://www.gnu.org/licenses/gpl-3.0.txt
* Unless required by applicable law or agreed to in writing, software distributed under the License is
* distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied
* See the License for the specific language governing permissions and limitations under the License.
*/
/*
* TODO: Massive redundancy: This is pretty much identical code to recalcTitlesSopecifiedRectypes.php and should be
* combined into one file, or call the same functions to do the work
*/
require_once dirname(__FILE__) . '/../../common/connect/applyCredentials.php';
require_once dirname(__FILE__) . '/../../common/php/dbMySqlWrappers.php';
if (isForAdminOnly("to rebuild titles")) {
return;
}
set_time_limit(0);
mysql_connection_overwrite(DATABASE);
require_once dirname(__FILE__) . '/../../common/php/utilsTitleMask.php';
//?db='.HEURIST_DBNAME);
$res = mysql_query('select rec_ID, rec_Title, rec_RecTypeID from Records where !rec_FlagTemporary order by rand()');
$recs = array();
while ($row = mysql_fetch_assoc($res)) {
$recs[$row['rec_ID']] = $row;
}
$masks = mysql__select_assoc('defRecTypes', 'rty_ID', 'rty_TitleMask', '1');
$updates = array();
$blank_count = 0;
$repair_count = 0;
示例5: dirname
* @license http://www.gnu.org/licenses/gpl-3.0.txt GNU License 3.0
* @package Heurist academic knowledge management system
* @subpackage !!!subpackagename for file such as Administration, Search, Edit, Application, Library
*/
/*
* selectDBForImport.php, Shows a list of registered databases to allow choosing source for structural elements
* First version 26-05-2011, by Juan Adriaanse
* @copyright (C) 2005-2010 University of Sydney Digital Innovation Unit.
* @link: http://HeuristScholar.org
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @package Heurist academic knowledge management system
* @todo
*/
require_once dirname(__FILE__) . '/../../common/connect/applyCredentials.php';
require_once dirname(__FILE__) . '/../../records/files/fileUtils.php';
if (isForAdminOnly("to import structural elements")) {
return;
}
?>
<html>
<head>
<title>Selection of source database for structure import</title>
<!-- YUI -->
<link rel="stylesheet" type="text/css" href="../../external/yui/2.8.2r1/build/fonts/fonts-min.css" />
<link rel="stylesheet" type="text/css" href="../../external/yui/2.8.2r1/build/paginator/assets/skins/sam/paginator.css">
<link type="text/css" rel="stylesheet" href="../../external/yui/2.8.2r1/build/datatable/assets/skins/sam/datatable.css">
<script type="text/javascript" src="../../external/yui/2.8.2r1/build/yahoo-dom-event/yahoo-dom-event.js"></script>
<script type="text/javascript" src="../../external/yui/2.8.2r1/build/element/element-min.js"></script>
<script type="text/javascript" src="../../external/yui/2.8.2r1/build/json/json-min.js"></script>
<script type="text/javascript" src="../../external/yui/2.8.2r1/build/datasource/datasource-min.js"></script>
示例6: dirname
* @link http://Sydney.edu.au/Heurist
* @version 3.1.0
* @license http://www.gnu.org/licenses/gpl-3.0.txt GNU License 3.0
* @package Heurist academic knowledge management system
* @subpackage !!!subpackagename for file such as Administration, Search, Edit, Application, Library
*/
/**
* filename, brief description, date of creation, by whom
* @copyright (C) 2005-2010 University of Sydney Digital Innovation Unit.
* @link: http://HeuristScholar.org
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @package Heurist academic knowledge management system
* @todo
**/
require_once dirname(__FILE__) . '/../../common/connect/applyCredentials.php';
if (isForAdminOnly("to rollback the database")) {
return;
}
?>
<html>
<head>
<link rel="stylesheet" type="text/css" href="../../common/css/global.css">
<link rel="stylesheet" type="text/css" href="../../common/css/edit.css">
<link rel="stylesheet" type="text/css" href="../../common/css/admin.css">
<style>
#form { width: 500px; margin:5px }
#form input[type=text], #form textarea { width: 100% }
.header div { font-weight: bold; margin-bottom: 10px }
.detail-type { float: left; width: 200px }
.current-val, .new-val { float: left; width: 400px }
.clearall { clear: both }
示例7: dirname
* @license http://www.gnu.org/licenses/gpl-3.0.txt GNU License 3.0
* @package Heurist academic knowledge management system
* @subpackage !!!subpackagename for file such as Administration, Search, Edit, Application, Library
*/
/**
* File: deleteCurrentDB.php Deletes the current database (owner group admins only)
* Ian Johnson 24 Dec 2011
* @copyright 2005-2010 University of Sydney Digital Innovation Unit.
* @link: http://HeuristScholar.org
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @package Heurist academic knowledge management system
* @todo
*
* **/
require_once dirname(__FILE__) . '/../../common/connect/applyCredentials.php';
if (isForAdminOnly("to delete a database")) {
return;
}
$dbname = $_REQUEST['db'];
if ($dbname == 'H3ExampleDB') {
// we require a valid DB incase the user deletes all DBs
print "<p>Deleteion of H3ExampleDB is not supported through this interface." . "<p><a href='" . HEURIST_BASE_URL . "admin/adminMenu.php?db=H3ExampleDB' >Return to Heurist</a>";
return;
}
if (!array_key_exists('mode', $_REQUEST)) {
print "<html>";
print "<head><meta content='text/html; charset=ISO-8859-1' http-equiv='content-type'>";
print "<title>Delete Current Heurist Database</title>";
print "<link rel='stylesheet' type='text/css' href='../../common/css/global.css'>";
print "<link rel='stylesheet' type='text/css' href='../../common/css/edit.css'>";
print "<link rel='stylesheet' type='text/css' href='../../common/css/admin.css'>";
示例8: dirname
* @author Ian Johnson <ian.johnson@sydney.edu.au>
* @license http://www.gnu.org/licenses/gpl-3.0.txt GNU License 3.0
* @version 3.1.0
*/
/*
* Licensed under the GNU License, Version 3.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at http://www.gnu.org/licenses/gpl-3.0.txt
* Unless required by applicable law or agreed to in writing, software distributed under the License is
* distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied
* See the License for the specific language governing permissions and limitations under the License.
*/
require_once dirname(__FILE__) . '/../../common/connect/applyCredentials.php';
require_once dirname(__FILE__) . '/../../common/php/dbMySqlWrappers.php';
require_once dirname(__FILE__) . "/../../common/php/saveRecord.php";
require_once dirname(__FILE__) . "/../../records/files/fileUtils.php";
if (isForAdminOnly("to sync (import FAIMS --> Heurist) FAIMS database")) {
return;
}
/*
require_once(dirname(__FILE__).'/../../common/php/dbMySqlWrappers.php');
require_once(dirname(__FILE__).'/../../common/php/getRecordInfoLibrary.php');
require_once(dirname(__FILE__)."/../../common/php/saveRecord.php");
require_once(dirname(__FILE__)."/../../records/files/uploadFile.php");
require_once(dirname(__FILE__).'/../../records/files/fileUtils.php');
require_once(dirname(__FILE__).'/../../search/actions/actionMethods.php');
*/
//@todo HARDCODED id of OriginalID
$dt_SourceRecordID = defined('DT_ORIGINAL_RECORD_ID') ? DT_ORIGINAL_RECORD_ID : 0;
if ($dt_SourceRecordID == 0) {
print "Detail type 'source record id' not defined";
return;
示例9: if
/**
* registerDB.php - Registers the current database with HeuristScholar.org/db=H3MasterIndex , stores
* metadata in the index database, sets registration code in sysIdentification table. Juan Adriaanse 26 May 2011.
* @copyright (C) 2005-2010 University of Sydney Digital Innovation Unit.
* @link: http://HeuristScholar.org
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @package Heurist academic knowledge management system
* @todo
**/
require_once(dirname(__FILE__).'/../../common/connect/applyCredentials.php');
require_once(dirname(__FILE__).'/../../common/php/dbMySqlWrappers.php');
require_once(dirname(__FILE__).'/../../records/files/fileUtils.php');
if(isForAdminOnly("to register a database")){
return;
}
$sError = null;
/*
$user_id = get_user_id();
// User must be system administrator or admin of the owners group for this database
if (!is_admin()) {
$sError = "You must be logged in as system administrator to register a database";
}else if (get_user_id() != 2) {
$sError = "Only the owner/creator of the database (user #2) may register the database. ".
"<br/><br/>This user will also own (and be able to edit) the registration record in the heuristscholar.org master index database";
return;
}
*/
示例10: dirname
if (!is_logged_in()) {
header('Location: ' . HEURIST_BASE_URL . 'common/connect/login.php?db='.HEURIST_DBNAME);
return;
}*/
// ------Administrative stuff ------------------------------------------------------------------------------------
// Verify credentials of the user and check that they are an administrator, check no-one else is trying to
// change the definitions at the same time
if (!isset($isNewDB)) {
$isNewDB = false;
}
$isExistingDB = !$isNewDB;
// for clarity
// Requires admin user if updating current database, even though get_definitions is open
// If it's processing the SQL file for a new database it does not
if ($isExistingDB) {
if (isForAdminOnly("to get structure elements from another database")) {
return;
}
}
require_once dirname(__FILE__) . '/../../common/php/dbMySqlWrappers.php';
global $errorCreatingTables;
$errorCreatingTables = FALSE;
global $dbname;
global $tempDBName;
if ($isNewDB) {
// For new database, insert coreDefinitions.txt directly into tables, no temp database required
$tempDBName = $newname;
$dbname = $newname;
} else {
// existing database needs temporary database to store data read and allow selection
$dbname = DATABASE;
示例11: dirname
* @package Heurist academic knowledge management system
* @subpackage !!!subpackagename for file such as Administration, Search, Edit, Application, Library
*/
/**
* File: clearCurrentDB.php Deletes all records/details/bookmarks from the current database (owner group admins only)
* Does not affect definitions. Resets record counter to 0.
* Ian Johnson 13/2/12
* @copyright 2005-2010 University of Sydney Digital Innovation Unit.
* @link: http://HeuristScholar.org
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @package Heurist academic knowledge management system
* @todo
*
* **/
require_once dirname(__FILE__) . '/../../common/connect/applyCredentials.php';
if (isForAdminOnly("to clear a database")) {
return;
}
$dbname = $_REQUEST['db'];
if (!array_key_exists('mode', $_REQUEST)) {
print "<html>";
print "<head><meta content='text/html; charset=ISO-8859-1' http-equiv='content-type'>";
print "<title>Clear Records from Current Heurist Database</title>";
print "<link rel='stylesheet' type='text/css' href='../../common/css/global.css'>";
print "<link rel='stylesheet' type='text/css' href='../../common/css/edit.css'>";
print "<link rel='stylesheet' type='text/css' href='../../common/css/admin.css'>";
print "</head>";
print "<body class='popup'>";
print "<div class='banner'><h2>Clear Records from Current Heurist database</h2></div>";
print "<div id='page-inner' style='overflow:auto'>";
print "<h4 style='display:inline-block; margin:0 5px 0 0'>" . "<span><img src='../../common/images/url_error.png' /> DANGER <img src='../../common/images/url_error.png' /></span>" . "</h4><h1 style='display:inline-block'>CLEAR ALL RECORDS FROM CURRENT DATABASE</h1><br>";
示例12: dirname
* @copyright (C) 2005-2016 University of Sydney
* @author Artem Osmakov <artem.osmakov@sydney.edu.au>
* @author Ian Johnson <ian.johnson@sydney.edu.au>
* @license http://www.gnu.org/licenses/gpl-3.0.txt GNU License 3.0
* @version 4.0
*/
/*
* Licensed under the GNU License, Version 3.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at http://www.gnu.org/licenses/gpl-3.0.txt
* Unless required by applicable law or agreed to in writing, software distributed under the License is
* distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied
* See the License for the specific language governing permissions and limitations under the License.
*/
require_once dirname(__FILE__) . '/../../common/connect/applyCredentials.php';
require_once dirname(__FILE__) . '/../../records/index/elasticSearchFunctions.php';
if (isForAdminOnly("to rebuild the Lucene indices")) {
return;
}
mysql_connection_overwrite(DATABASE);
if (mysql_error()) {
die("MySQL error - unable to connect to database, MySQL error: " + mysql_error());
}
print "<html><head><link rel=stylesheet href='../../common/css/global.css'></head><body class='popup'>\n Rebuilding Lucene indices for all tables ... ";
$code = buildAllIndices(HEURIST_DBNAME);
if ($code == 0) {
print "<html><head><link rel=stylesheet href='../../common/css/global.css'></head><body class='popup'>\n <h2> Database indices have been rebuilt, please check for errors above</h2>";
} else {
die('<p>Failed to rebuild indices, please consult Heurist support team (error code: ' + $code + ')</p>');
}
print "</body>";
print "</html>";
示例13: dirname
* @subpackage !!!subpackagename for file such as Administration, Search, Edit, Application, Library
*/
/* getUserFromDB.php - gets a user definition from an existing database and adds to current database
* Ian Johnson Artem Osmakov 25 - 28 Oct 2011
* @copyright (C) 2005-2010 University of Sydney Digital Innovation Unit.
* @link: http://HeuristScholar.org
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @package Heurist academic knowledge management system
* @param includeUgrps=1 will output user and group information in addition to definitions
* @param approvedDefsOnly=1 will only output Reserved and Approved definitions
* @todo
*/
require_once dirname(__FILE__) . '/../../common/connect/applyCredentials.php';
require_once dirname(__FILE__) . '/../../common/php/dbMySqlWrappers.php';
//require_once(dirname(__FILE__).'/../../admin/ugrps/saveUsergrpsFs.php');
if (isForAdminOnly("to import user")) {
return;
}
?>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Import a User</title>
<link rel="stylesheet" type="text/css" href="../../common/css/global.css">
<link rel="stylesheet" type="text/css" href="../../common/css/admin.css">
</head>
<body class="popup">
<div class="banner"><h2>Import a User</h2></div>
<div id="page-inner" style="overflow:auto;padding-left: 20px;">
示例14: dirname
* @license http://www.gnu.org/licenses/gpl-3.0.txt GNU License 3.0
* @version 3.1.0
*/
/*
* Licensed under the GNU License, Version 3.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at http://www.gnu.org/licenses/gpl-3.0.txt
* Unless required by applicable law or agreed to in writing, software distributed under the License is
* distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied
* See the License for the specific language governing permissions and limitations under the License.
*/
require_once dirname(__FILE__) . '/../../common/connect/applyCredentials.php';
require_once dirname(__FILE__) . '/../../common/php/dbMySqlWrappers.php';
require_once dirname(__FILE__) . '/../../search/parseQueryToSQL.php';
require_once dirname(__FILE__) . '/../../common/php/getRecordInfoLibrary.php';
require_once dirname(__FILE__) . "/../../records/files/fileUtils.php";
if (isForAdminOnly("to export to FAIMS tDAR repository")) {
return;
}
/** The list of attachment files */
define('API_FIELD_UPLOAD_FILE', "uploadFile");
/** The meta-data describing the files, an xml file itself, adhering to the published schema */
define('API_FIELD_RECORD', "record");
/** The project to which the files are to be added. Will overwrite anything within the record */
define('API_FIELD_PROJECT_ID', "projectId");
/*
$dt_SourceRecordID = (defined('DT_ORIGINAL_RECORD_ID')?DT_ORIGINAL_RECORD_ID:0);
if($dt_SourceRecordID==0){
print "Detail type 'source record id' not defined";
return;
}
示例15: dirname
* mimetypes listing
*
* @author Tom Murtagh
* @author Kim Jackson
* @author Ian Johnson <ian.johnson@sydney.edu.au>
* @author Stephen White
* @author Artem Osmakov <artem.osmakov@sydney.edu.au>
* @copyright (C) 2005-2016 University of Sydney
* @link http://HeuristNetwork.org
* @version 3.1.0
* @license http://www.gnu.org/licenses/gpl-3.0.txt GNU License 3.0
* @package Heurist academic knowledge management system
* @subpackage !!!subpackagename for file such as Administration, Search, Edit, Application, Library
*/
require_once dirname(__FILE__) . '/../../../common/connect/applyCredentials.php';
if (isForAdminOnly("to modify database structure")) {
return;
}
?>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Manage Mime types</title>
<link rel=stylesheet href="../../../common/css/global.css">
<!-- YUI -->
<link rel="stylesheet" type="text/css" href="../../../external/yui/2.8.2r1/build/fonts/fonts-min.css" />
<link rel="stylesheet" type="text/css" href="../../../external/yui/2.8.2r1/build/tabview/assets/skins/sam/tabview.css" />
<script type="text/javascript" src="../../../external/yui/2.8.2r1/build/yahoo-dom-event/yahoo-dom-event.js"></script>