Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
b0324df6
Commit
b0324df6
authored
Dec 07, 2006
by
Nigel McNie
Committed by
Nigel McNie
Dec 07, 2006
Browse files
Moved all earth admin files around. Most of them are broken at this point,
subsequent commits will fix them.
parent
69b3f982
Changes
14
Hide whitespace changes
Inline
Side-by-side
htdocs/admin/options/index.php
deleted
100644 → 0
View file @
69b3f982
<?php
/**
* This program is part of Mahara
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* @package mahara
* @subpackage admin
* @author Nigel McNie <nigel@catalyst.net.nz>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL
* @copyright (C) 2006,2007 Catalyst IT Ltd http://catalyst.net.nz
*
*/
define
(
'INTERNAL'
,
1
);
define
(
'ADMIN'
,
1
);
define
(
'MENUITEM'
,
'siteoptions'
);
require
(
dirname
(
dirname
(
dirname
(
__FILE__
)))
.
'/init.php'
);
require_once
(
'pieforms/pieform.php'
);
$langoptions
=
get_languages
();
$themeoptions
=
get_themes
();
$yesno
=
array
(
true
=>
get_string
(
'yes'
),
false
=>
get_string
(
'no'
));
$siteoptionform
=
pieform
(
array
(
'name'
=>
'siteoptions'
,
'ajaxpost'
=>
true
,
'elements'
=>
array
(
'sitename'
=>
array
(
'type'
=>
'text'
,
'title'
=>
get_string
(
'sitename'
,
'admin'
),
'description'
=>
get_string
(
'sitenamedescription'
,
'admin'
),
'defaultvalue'
=>
get_config
(
'sitename'
),
),
'language'
=>
array
(
'type'
=>
'select'
,
'title'
=>
get_string
(
'language'
,
'admin'
),
'description'
=>
get_string
(
'sitelanguagedescription'
,
'admin'
),
'defaultvalue'
=>
get_config
(
'language'
),
'collapseifoneoption'
=>
true
,
'options'
=>
$langoptions
,
),
'theme'
=>
array
(
'type'
=>
'select'
,
'title'
=>
get_string
(
'theme'
,
'admin'
),
'description'
=>
get_string
(
'sitethemedescription'
,
'admin'
),
'defaultvalue'
=>
get_config
(
'theme'
),
'collapseifoneoption'
=>
true
,
'options'
=>
$themeoptions
,
),
'viruschecking'
=>
array
(
'type'
=>
'checkbox'
,
'title'
=>
get_string
(
'viruschecking'
,
'admin'
),
'description'
=>
get_string
(
'viruscheckingdescription'
,
'admin'
),
'defaultvalue'
=>
get_config
(
'viruschecking'
),
),
'pathtoclam'
=>
array
(
'type'
=>
'text'
,
'title'
=>
get_string
(
'pathtoclam'
,
'admin'
),
'description'
=>
get_string
(
'pathtoclamdescription'
,
'admin'
),
'defaultvalue'
=>
get_config
(
'pathtoclam'
),
),
'sessionlifetime'
=>
array
(
'type'
=>
'text'
,
'size'
=>
4
,
'title'
=>
get_string
(
'sessionlifetime'
,
'admin'
),
'description'
=>
get_string
(
'sessionlifetimedescription'
,
'admin'
),
'defaultvalue'
=>
get_config
(
'session_timeout'
)
/
60
,
),
'allowpublicviews'
=>
array
(
'type'
=>
'select'
,
'title'
=>
get_string
(
'allowpublicviews'
,
'admin'
),
'description'
=>
get_string
(
'allowpublicviewsdescription'
,
'admin'
),
'defaultvalue'
=>
get_config
(
'allowpublicviews'
),
'options'
=>
$yesno
,
),
'artefactviewinactivitytime'
=>
array
(
'type'
=>
'expiry'
,
'title'
=>
get_string
(
'artefactviewinactivitytime'
,
'admin'
),
'description'
=>
get_string
(
'artefactviewinactivitytimedescription'
,
'admin'
),
'defaultvalue'
=>
get_config
(
'artefactviewinactivitytime'
),
),
'submit'
=>
array
(
'type'
=>
'submit'
,
'value'
=>
get_string
(
'updatesiteoptions'
,
'admin'
)
),
)
));
function
siteoptions_fail
(
$field
)
{
json_reply
(
'local'
,
get_string
(
'setsiteoptionsfailed'
,
'admin'
,
get_string
(
$field
)));
}
function
siteoptions_submit
(
$values
)
{
$fields
=
array
(
'sitename'
,
'language'
,
'theme'
,
'pathtoclam'
,
'allowpublicviews'
,
'artefactviewinactivitytime'
);
foreach
(
$fields
as
$field
)
{
if
(
!
set_config
(
$field
,
$values
[
$field
]))
{
siteoptions_fail
(
$field
);
}
}
// submitted sessionlifetime is in minutes; db entry session_timeout is in seconds
if
(
!
set_config
(
'session_timeout'
,
$values
[
'sessionlifetime'
]
*
60
))
{
siteoptions_fail
(
'sessionlifetime'
);
}
// Submitted value is on/off; database entry should be 1/0
if
(
!
set_config
(
'viruschecking'
,
(
int
)
(
$values
[
'viruschecking'
]
==
'on'
)))
{
siteoptions_fail
(
'viruschecking'
);
}
json_reply
(
false
,
get_string
(
'siteoptionsset'
,
'admin'
));
}
$smarty
=
smarty
();
$smarty
->
assign
(
'SITEOPTIONFORM'
,
$siteoptionform
);
$smarty
->
display
(
'admin/options/index.tpl'
);
?>
htdocs/admin/deletemenuitem.json.php
→
htdocs/admin/
site/
deletemenuitem.json.php
View file @
b0324df6
...
...
@@ -26,14 +26,14 @@
define
(
'INTERNAL'
,
1
);
define
(
'ADMIN'
,
1
);
require
(
dirname
(
dirname
(
__FILE__
))
.
'/init.php'
);
require
(
dirname
(
dirname
(
dirname
(
__FILE__
))
)
.
'/init.php'
);
$itemid
=
param_integer
(
'itemid'
);
if
(
!
delete_records
(
'site_menu'
,
'id'
,
$itemid
))
{
if
(
!
delete_records
(
'site_menu'
,
'id'
,
$itemid
))
{
json_reply
(
'local'
,
get_string
(
'deletefailed'
,
'admin'
));
}
json_reply
(
false
,
get_string
(
'menuitemdeleted'
,
'admin'
));
json_reply
(
false
,
get_string
(
'menuitemdeleted'
,
'admin'
));
?>
htdocs/admin/editchangepage.json.php
→
htdocs/admin/
site/
editchangepage.json.php
View file @
b0324df6
...
...
@@ -26,18 +26,18 @@
define
(
'INTERNAL'
,
1
);
define
(
'ADMIN'
,
1
);
require
(
dirname
(
dirname
(
__FILE__
))
.
'/init.php'
);
require
(
dirname
(
dirname
(
dirname
(
__FILE__
))
)
.
'/init.php'
);
$pagename
=
param_alpha
(
'pagename'
);
$data
[
'pagename'
]
=
$pagename
;
if
(
!
$page
=
@
get_record
(
'site_content'
,
'name'
,
$pagename
))
{
json_reply
(
'local'
,
get_string
(
'loadsitepagefailed'
,
'admin'
));
if
(
!
$page
=
@
get_record
(
'site_content'
,
'name'
,
$pagename
))
{
json_reply
(
'local'
,
get_string
(
'loadsitepagefailed'
,
'admin'
));
}
$data
[
'content'
]
=
$page
->
content
;
$data
[
'error'
]
=
false
;
$data
[
'error'
]
=
false
;
$data
[
'message'
]
=
get_string
(
'sitepageloaded'
,
'admin'
);
json_headers
();
echo
json_encode
(
$data
);
...
...
htdocs/admin/getmenuitems.json.php
→
htdocs/admin/
site/
getmenuitems.json.php
View file @
b0324df6
...
...
@@ -26,7 +26,7 @@
define
(
'INTERNAL'
,
1
);
define
(
'ADMIN'
,
1
);
require
(
dirname
(
dirname
(
__FILE__
))
.
'/init.php'
);
require
(
dirname
(
dirname
(
dirname
(
__FILE__
))
)
.
'/init.php'
);
$public
=
(
int
)
param_boolean
(
'public'
);
...
...
htdocs/admin/
edit
menu.php
→
htdocs/admin/
site/
menu.php
View file @
b0324df6
...
...
@@ -24,10 +24,11 @@
*
*/
define
(
'INTERNAL'
,
1
);
define
(
'INTERNAL'
,
1
);
define
(
'ADMIN'
,
1
);
define
(
'MENUITEM'
,
'menueditor'
);
require
(
dirname
(
dirname
(
__FILE__
))
.
'/init.php'
);
define
(
'MENUITEM'
,
'configsite'
);
define
(
'SUBMENUITEM'
,
'editmenu'
);
require
(
dirname
(
dirname
(
dirname
(
__FILE__
)))
.
'/init.php'
);
$strings
=
array
(
'edit'
,
'delete'
,
'update'
,
'cancel'
,
'add'
,
'name'
,
'unknownerror'
);
$adminstrings
=
array
(
'deletefailed'
,
'deletingmenuitem'
,
'savingmenuitem'
,
...
...
htdocs/admin/site/options.php
View file @
b0324df6
...
...
@@ -24,9 +24,10 @@
*
*/
define
(
'INTERNAL'
,
1
);
define
(
'ADMIN'
,
1
);
define
(
'MENUITEM'
,
'siteoptions'
);
define
(
'INTERNAL'
,
1
);
define
(
'ADMIN'
,
1
);
define
(
'MENUITEM'
,
'configsite'
);
define
(
'SUBMENUITEM'
,
'siteoptions'
);
require
(
dirname
(
dirname
(
dirname
(
__FILE__
)))
.
'/init.php'
);
require_once
(
'pieforms/pieform.php'
);
...
...
@@ -94,15 +95,6 @@ $siteoptionform = pieform(array(
'description'
=>
get_string
(
'artefactviewinactivitytimedescription'
,
'admin'
),
'defaultvalue'
=>
get_config
(
'artefactviewinactivitytime'
),
),
'contactaddress'
=>
array
(
'type'
=>
'text'
,
'title'
=>
get_string
(
'contactaddress'
,
'admin'
),
'description'
=>
get_string
(
'contactaddressdescription'
,
'admin'
),
'defaultvalue'
=>
get_config
(
'contactaddress'
),
'rules'
=>
array
(
'email'
=>
true
)
),
'submit'
=>
array
(
'type'
=>
'submit'
,
'value'
=>
get_string
(
'updatesiteoptions'
,
'admin'
)
...
...
@@ -116,8 +108,7 @@ function siteoptions_fail($field) {
function
siteoptions_submit
(
$values
)
{
$fields
=
array
(
'sitename'
,
'language'
,
'theme'
,
'pathtoclam'
,
'allowpublicviews'
,
'artefactviewinactivitytime'
,
'contactaddress'
);
'allowpublicviews'
,
'artefactviewinactivitytime'
);
foreach
(
$fields
as
$field
)
{
if
(
!
set_config
(
$field
,
$values
[
$field
]))
{
siteoptions_fail
(
$field
);
...
...
htdocs/admin/
edit
sitepage.php
→
htdocs/admin/site
/
page
s
.php
View file @
b0324df6
...
...
@@ -24,10 +24,11 @@
*
*/
define
(
'INTERNAL'
,
1
);
define
(
'INTERNAL'
,
1
);
define
(
'ADMIN'
,
1
);
define
(
'MENUITEM'
,
'pageeditor'
);
require
(
dirname
(
dirname
(
__FILE__
))
.
'/init.php'
);
define
(
'MENUITEM'
,
'configsite'
);
define
(
'SUBMENUITEM'
,
'pageeditor'
);
require
(
dirname
(
dirname
(
dirname
(
__FILE__
)))
.
'/init.php'
);
require_once
(
'pieforms/pieform.php'
);
$sitepages
=
get_records_array
(
'site_content'
);
...
...
htdocs/admin/updatemenu.json.php
→
htdocs/admin/
site/
updatemenu.json.php
View file @
b0324df6
...
...
@@ -26,7 +26,7 @@
define
(
'INTERNAL'
,
1
);
define
(
'ADMIN'
,
1
);
require
(
dirname
(
dirname
(
__FILE__
))
.
'/init.php'
);
require
(
dirname
(
dirname
(
dirname
(
__FILE__
))
)
.
'/init.php'
);
$type
=
param_alpha
(
'type'
);
// external list or admin file
$name
=
param_variable
(
'name'
);
...
...
htdocs/admin/user
management
/admin
user
s.php
→
htdocs/admin/user
s
/admins.php
View file @
b0324df6
...
...
@@ -28,7 +28,7 @@
// here might need to be fixed there too.
define
(
'INTERNAL'
,
1
);
define
(
'ADMIN'
,
1
);
define
(
'MENUITEM'
,
'
usermanagement
'
);
define
(
'MENUITEM'
,
'
configusers
'
);
define
(
'SUBMENUITEM'
,
'adminusers'
);
require
(
dirname
(
dirname
(
dirname
(
__FILE__
)))
.
'/init.php'
);
require_once
(
'pieforms/pieform.php'
);
...
...
htdocs/admin/institutions.php
→
htdocs/admin/
users/
institutions.php
View file @
b0324df6
...
...
@@ -26,8 +26,9 @@
define
(
'INTERNAL'
,
1
);
define
(
'ADMIN'
,
1
);
define
(
'MENUITEM'
,
'institutions'
);
require
(
dirname
(
dirname
(
__FILE__
))
.
'/init.php'
);
define
(
'MENUITEM'
,
'configusers'
);
define
(
'SUBMENUITEM'
,
'institutions'
);
require
(
dirname
(
dirname
(
dirname
(
__FILE__
)))
.
'/init.php'
);
require_once
(
'pieforms/pieform.php'
);
$smarty
=
smarty
();
...
...
@@ -176,6 +177,7 @@ if ($institution || $add) {
$smarty
->
assign
(
'institution_form'
,
pieform
(
array
(
'name'
=>
'institution'
,
'renderer'
=>
'table'
,
'elements'
=>
$elements
)));
...
...
htdocs/admin/user
management/admin
notifications.php
→
htdocs/admin/user
s/
notifications.php
View file @
b0324df6
...
...
@@ -26,7 +26,7 @@
define
(
'INTERNAL'
,
1
);
define
(
'ADMIN'
,
1
);
define
(
'MENUITEM'
,
'
usermanagement
'
);
define
(
'MENUITEM'
,
'
configusers
'
);
define
(
'SUBMENUITEM'
,
'adminnotifications'
);
require
(
dirname
(
dirname
(
dirname
(
__FILE__
)))
.
'/init.php'
);
...
...
htdocs/admin/user
management
/staff
users
.php
→
htdocs/admin/user
s
/staff.php
View file @
b0324df6
...
...
@@ -28,7 +28,7 @@
// here might need to be fixed there too.
define
(
'INTERNAL'
,
1
);
define
(
'ADMIN'
,
1
);
define
(
'MENUITEM'
,
'
usermanagement
'
);
define
(
'MENUITEM'
,
'
configusers
'
);
define
(
'SUBMENUITEM'
,
'staffusers'
);
require
(
dirname
(
dirname
(
dirname
(
__FILE__
)))
.
'/init.php'
);
require_once
(
'pieforms/pieform.php'
);
...
...
@@ -68,7 +68,7 @@ function staffusers_submit($values) {
WHERE id IN ('
.
join
(
','
,
$values
[
'users'
])
.
')'
);
db_commit
();
$SESSION
->
add_ok_msg
(
get_string
(
'staffusersupdated'
,
'admin'
));
redirect
(
get_config
(
'wwwroot'
)
.
'admin/user
management
/staff
users
.php'
);
redirect
(
get_config
(
'wwwroot'
)
.
'admin/user
s
/staff.php'
);
}
$smarty
->
assign
(
'staffusersform'
,
pieform
(
$form
));
...
...
htdocs/admin/user
management
/suspended
users
.php
→
htdocs/admin/user
s
/suspended.php
View file @
b0324df6
...
...
@@ -26,7 +26,7 @@
define
(
'INTERNAL'
,
1
);
define
(
'ADMIN'
,
1
);
define
(
'MENUITEM'
,
'
usermanagement
'
);
define
(
'MENUITEM'
,
'
configusers
'
);
define
(
'SUBMENUITEM'
,
'suspendedusers'
);
require
(
dirname
(
dirname
(
dirname
(
__FILE__
)))
.
'/init.php'
);
...
...
htdocs/admin/user
management
/uploadcsv.php
→
htdocs/admin/user
s
/uploadcsv.php
View file @
b0324df6
...
...
@@ -26,7 +26,7 @@
define
(
'INTERNAL'
,
1
);
define
(
'ADMIN'
,
1
);
define
(
'MENUITEM'
,
'
usermanagement
'
);
define
(
'MENUITEM'
,
'
configusers
'
);
define
(
'SUBMENUITEM'
,
'uploadcsv'
);
require
(
dirname
(
dirname
(
dirname
(
__FILE__
)))
.
'/init.php'
);
require_once
(
'pieforms/pieform.php'
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment