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
a54e7cbc
Commit
a54e7cbc
authored
Aug 20, 2007
by
Nigel McNie
Browse files
Merge branch 'master' of
git+ssh://git.catalyst.net.nz/var/git/mahara
parents
f3074785
fa77003c
Changes
216
Hide whitespace changes
Inline
Side-by-side
.gitignore
View file @
a54e7cbc
logs
htdocs/js/MochiKit/Packed.js
htdocs/.project
htdocs/.projectOptions
htdocs/.settings/*
...
...
@@ -8,3 +7,4 @@ mahara-*.tar.bz2
mahara-*.tar.gz
mahara-*.zip
*.swp
.patches
debian/NEWS
0 → 100644
View file @
a54e7cbc
mahara (0.9.0~dev) unstable; urgency=low
* The new networking support in Mahara requires the curl, openssl and xmlrpc
libs. If they are not installed, you will see environment level errors on each
screen of your Mahara installation. You can solve this by disabling logging of
environment level errors in config.php, or installing php5-{curl,openssl,xmlrpc}
-- Nigel McNie <nigel@catalyst.net.nz> Thu, 9 Aug 2007 17:10:06 +1200
debian/changelog
View file @
a54e7cbc
mahara (0.9.0~dev) unstable; urgency=low
* 0.9.0 Dev version
-- Nigel McNie <nigel@catalyst.net.nz> Wed, 8 Aug 2007 18:35:50 +1200
mahara (0.8.0~dev) unstable; urgency=low
* 0.8.0 Dev version
...
...
htdocs/account/activity/index.json.php
View file @
a54e7cbc
...
...
@@ -59,7 +59,6 @@ $limit = param_integer('limit', 10);
$offset
=
param_integer
(
'offset'
,
0
);
$userid
=
$USER
->
get
(
'id'
);
$prefix
=
get_config
(
'dbprefix'
);
if
(
$type
==
'all'
)
{
$count
=
count_records
(
'notification_internal_activity'
,
'usr'
,
$userid
);
...
...
@@ -67,10 +66,10 @@ if ($type == 'all') {
'ctime DESC'
,
'*'
,
$offset
,
$limit
);
}
else
if
(
$type
==
'adminmessages'
&&
$USER
->
get
(
'admin'
))
{
$count
=
count_records_select
(
'notification_internal_activity'
,
'usr = ? AND type IN (
SELECT name FROM
'
.
$prefix
.
'
activity_type WHERE admin = ?)'
,
SELECT name FROM
{
activity_type
}
WHERE admin = ?)'
,
array
(
$userid
,
1
));
$records
=
get_records_select_array
(
'notification_internal_activity'
,
'usr = ? AND type IN (
SELECT name FROM
'
.
$prefix
.
'
activity_type WHERE admin = ?)'
,
SELECT name FROM
{
activity_type
}
WHERE admin = ?)'
,
array
(
$userid
,
1
),
'ctime DESC'
,
'*'
,
$offset
,
$limit
);
}
...
...
htdocs/account/activity/index.php
View file @
a54e7cbc
...
...
@@ -25,8 +25,7 @@
*/
define
(
'INTERNAL'
,
1
);
define
(
'MENUITEM'
,
'account'
);
define
(
'SUBMENUITEM'
,
'activity'
);
define
(
'MENUITEM'
,
'settings/recentactivity'
);
define
(
'SECTION_PLUGINTYPE'
,
'core'
);
define
(
'SECTION_PLUGINNAME'
,
'account'
);
define
(
'SECTION_PAGE'
,
'activity'
);
...
...
htdocs/account/activity/preferences/index.php
View file @
a54e7cbc
...
...
@@ -25,8 +25,7 @@
*/
define
(
'INTERNAL'
,
1
);
define
(
'MENUITEM'
,
'account'
);
define
(
'SUBMENUITEM'
,
'activityprefs'
);
define
(
'MENUITEM'
,
'settings/activitypreferences'
);
define
(
'SECTION_PLUGINTYPE'
,
'core'
);
define
(
'SECTION_PLUGINNAME'
,
'account'
);
define
(
'SECTION_PAGE'
,
'activitypreferences'
);
...
...
htdocs/account/index.php
View file @
a54e7cbc
...
...
@@ -25,8 +25,7 @@
*/
define
(
'INTERNAL'
,
1
);
define
(
'MENUITEM'
,
'account'
);
define
(
'SUBMENUITEM'
,
'accountprefs'
);
define
(
'MENUITEM'
,
'settings/preferences'
);
define
(
'SECTION_PLUGINTYPE'
,
'core'
);
define
(
'SECTION_PLUGINNAME'
,
'account'
);
define
(
'SECTION_PAGE'
,
'preferences'
);
...
...
@@ -72,7 +71,7 @@ else {
}
$elements
[
'accountoptionsdesc'
]
=
array
(
'value'
=>
'<tr><td colspan="2"><p>
You can set general
account
options
here
</p></td></tr>'
'value'
=>
'<tr><td colspan="2"><p>
'
.
get_string
(
'
accountoptions
desc'
,
'account'
)
.
'
</p></td></tr>'
);
$elements
[
'friendscontrol'
]
=
array
(
'type'
=>
'radio'
,
...
...
htdocs/account/watchlist/index.json.php
View file @
a54e7cbc
...
...
@@ -35,7 +35,6 @@ $stopmonitoring = param_integer('stopmonitoring', 0);
$userlist
=
param_alpha
(
'userlist'
,
null
);
$getartefacts
=
param_integer
(
'getartefacts'
,
0
);
$prefix
=
get_config
(
'dbprefix'
);
$userid
=
$USER
->
get
(
'id'
);
if
(
$stopmonitoring
)
{
...
...
@@ -51,8 +50,8 @@ if ($stopmonitoring) {
delete_records
(
'usr_watchlist_artefact'
,
'usr'
,
$userid
,
'artefact'
,
$m
[
1
]);
$count
++
;
}
else
if
(
preg_match
(
'/^stop
communitie
s\-(\d+)$/'
,
$k
,
$m
))
{
delete_records
(
'usr_watchlist_
community
'
,
'usr'
,
$userid
,
'
community
'
,
$m
[
1
]);
else
if
(
preg_match
(
'/^stop
group
s\-(\d+)$/'
,
$k
,
$m
))
{
delete_records
(
'usr_watchlist_
group
'
,
'usr'
,
$userid
,
'
group
'
,
$m
[
1
]);
$count
++
;
}
}
...
...
@@ -68,9 +67,9 @@ if ($stopmonitoring) {
if
(
!
empty
(
$userlist
))
{
if
(
$userlist
==
'views'
)
{
$sql
=
'SELECT DISTINCT u.*
FROM
'
.
$prefix
.
'
usr u
JOIN
'
.
$prefix
.
'
view v ON v.owner = u.id
JOIN
'
.
$prefix
.
'
usr_watchlist_view w ON w.view = v.id
FROM
{
usr
}
u
JOIN
{
view
}
v ON v.owner = u.id
JOIN
{
usr_watchlist_view
}
w ON w.view = v.id
WHERE w.usr = ?'
;
if
(
!
$users
=
get_records_sql_array
(
$sql
,
array
(
$userid
)))
{
...
...
@@ -79,9 +78,9 @@ if (!empty($userlist)) {
}
else
if
(
$userlist
==
'artefacts'
)
{
$sql
=
'SELECT DISTINCT u.*
FROM
'
.
$prefix
.
'
usr u
JOIN
'
.
$prefix
.
'
artefact a ON a.owner = u.id
JOIN
'
.
$prefix
.
'
usr_watchlist_artefact w ON w.artefact = a.id
FROM
{
usr
}
u
JOIN
{
artefact
}
a ON a.owner = u.id
JOIN
{
usr_watchlist_artefact
}
w ON w.artefact = a.id
WHERE w.usr = ?'
;
if
(
!
$users
=
get_records_sql_array
(
$sql
,
array
(
$userid
)))
{
...
...
@@ -107,7 +106,6 @@ $limit = param_integer('limit', 10);
$offset
=
param_integer
(
'offset'
,
0
);
$userid
=
$USER
->
get
(
'id'
);
$prefix
=
get_config
(
'dbprefix'
);
$count
=
0
;
$records
=
array
();
...
...
@@ -115,8 +113,8 @@ $records = array();
if
(
$type
==
'views'
)
{
$count
=
count_records
(
'usr_watchlist_view'
,
'usr'
,
$userid
);
$sql
=
'SELECT v.*, v.title AS name, w.recurse
FROM
'
.
$prefix
.
'
view v
JOIN
'
.
$prefix
.
'
usr_watchlist_view w ON w.view = v.id
FROM
{
view
}
v
JOIN
{
usr_watchlist_view
}
w ON w.view = v.id
WHERE w.usr = ?'
;
$values
=
array
(
$userid
);
if
(
isset
(
$owner
))
{
...
...
@@ -127,20 +125,20 @@ if ($type == 'views') {
ORDER BY v.mtime DESC'
;
$records
=
get_records_sql_array
(
$sql
,
$values
,
$offset
,
$limit
);
}
else
if
(
$type
==
'
communitie
s'
)
{
$count
=
count_records
(
'usr_watchlist_
community
'
,
'usr'
,
$userid
);
$sql
=
'SELECT
c
.*
FROM
'
.
$prefix
.
'community c
JOIN
'
.
$prefix
.
'usr_watchlist_community w ON w.community
=
c
.id
else
if
(
$type
==
'
group
s'
)
{
$count
=
count_records
(
'usr_watchlist_
group
'
,
'usr'
,
$userid
);
$sql
=
'SELECT
g
.*
FROM
{group} g
JOIN
{usr_watchlist_group} w ON w.group
=
g
.id
WHERE w.usr = ?
ORDER BY
c
.mtime DESC'
;
ORDER BY
g
.mtime DESC'
;
$records
=
get_records_sql_array
(
$sql
,
array
(
$userid
),
$offset
,
$limit
);
}
else
if
(
$type
==
'artefacts'
)
{
$count
=
count_records
(
'usr_watchlist_artefact'
,
'usr'
,
$userid
);
$sql
=
'SELECT a.* , a.title AS name, w.view, w.recurse
FROM
'
.
$prefix
.
'
artefact a
JOIN
'
.
$prefix
.
'
usr_watchlist_artefact w ON w.artefact = a.id
FROM
{
artefact
}
a
JOIN
{
usr_watchlist_artefact
}
w ON w.artefact = a.id
WHERE w.usr = ?'
;
$values
=
array
(
$userid
);
if
(
isset
(
$owner
))
{
...
...
htdocs/account/watchlist/index.php
View file @
a54e7cbc
...
...
@@ -25,8 +25,7 @@
*/
define
(
'INTERNAL'
,
1
);
define
(
'MENUITEM'
,
'account'
);
define
(
'SUBMENUITEM'
,
'watchlist'
);
define
(
'MENUITEM'
,
'settings/mywatchlist'
);
define
(
'SECTION_PLUGINTYPE'
,
'core'
);
define
(
'SECTION_PLUGINNAME'
,
'account'
);
define
(
'SECTION_PAGE'
,
'watchlist'
);
...
...
@@ -34,7 +33,7 @@ define('SECTION_PAGE', 'watchlist');
require
(
dirname
(
dirname
(
dirname
(
__FILE__
)))
.
'/init.php'
);
$viewstring
=
get_string
(
'views'
,
'activity'
);
$
community
string
=
get_string
(
'
communitie
s'
,
'activity'
);
$
group
string
=
get_string
(
'
group
s'
,
'activity'
);
$artefactstring
=
get_string
(
'artefacts'
,
'activity'
);
$monitoredstring
=
get_string
(
'monitored'
,
'activity'
);
$allusersstring
=
get_string
(
'allusers'
);
...
...
@@ -50,8 +49,8 @@ var watchlist = new TableRenderer(
[
function(r, d) {
var url = '';
if (d.type == '
communitie
s') {
url = '{$wwwroot}/contacts/
communitie
s/view.php?id=' + r.id;
if (d.type == '
group
s') {
url = '{$wwwroot}/contacts/
group
s/view.php?id=' + r.id;
}
else if (d.type == 'views') {
url = '{$wwwroot}/view/view.php?view=' + r.id;
...
...
@@ -79,9 +78,9 @@ watchlist.updateOnLoad();
watchlist.rowfunction = function(r, n) { return TR({'id': r.id, 'class': 'view r' + (n % 2)}); }
function changeTitle(title) {
var titles = { 'views': '{$viewstring}', '
communities': '{$community
string}', 'artefacts': '{$artefactstring}' };
var titles = { 'views': '{$viewstring}', '
groups': '{$group
string}', 'artefacts': '{$artefactstring}' };
$('typeheader').innerHTML = '{$monitoredstring} ' + titles[title];
if (title != '
communitie
s') {
if (title != '
group
s') {
$('typeandchildren').innerHTML = '{$andchildren}';
}
else {
...
...
@@ -130,7 +129,7 @@ function statusChange() {
}
changeTitle(typevalue);
$('messagediv').innerHTML = '';
if (typevalue == '
communitie
s') {
if (typevalue == '
group
s') {
$('user').options.length = 0;
$('user').disabled = true;
}
...
...
@@ -159,11 +158,10 @@ function statusChange() {
JAVASCRIPT;
$prefix
=
get_config
(
'dbprefix'
);
$sql
=
'SELECT DISTINCT u.*
FROM
'
.
$prefix
.
'
usr u
JOIN
'
.
$prefix
.
'
view v ON v.owner = u.id
JOIN
'
.
$prefix
.
'
usr_watchlist_view w ON w.view = v.id
FROM
{
usr
}
u
JOIN
{
view
}
v ON v.owner = u.id
JOIN
{
usr_watchlist_view
}
w ON w.view = v.id
WHERE w.usr = ?'
;
if
(
!
$viewusers
=
get_records_sql_array
(
$sql
,
array
(
$USER
->
get
(
'id'
))))
{
...
...
htdocs/admin/extensions/pluginconfig.php
View file @
a54e7cbc
...
...
@@ -26,8 +26,7 @@
define
(
'INTERNAL'
,
1
);
define
(
'ADMIN'
,
1
);
define
(
'MENUITEM'
,
'configextensions'
);
define
(
'SUBMENUITEM'
,
'pluginadmin'
);
define
(
'MENUITEM'
,
'configextensions/pluginadmin'
);
require
(
dirname
(
dirname
(
dirname
(
__FILE__
)))
.
'/init.php'
);
define
(
'TITLE'
,
get_string
(
'pluginadmin'
,
'admin'
));
require_once
(
'pieforms/pieform.php'
);
...
...
htdocs/admin/extensions/plugins.php
View file @
a54e7cbc
...
...
@@ -26,8 +26,7 @@
define
(
'INTERNAL'
,
1
);
define
(
'ADMIN'
,
1
);
define
(
'MENUITEM'
,
'configextensions'
);
define
(
'SUBMENUITEM'
,
'pluginadmin'
);
define
(
'MENUITEM'
,
'configextensions/pluginadmin'
);
require
(
dirname
(
dirname
(
dirname
(
__FILE__
)))
.
'/init.php'
);
define
(
'TITLE'
,
get_string
(
'pluginadmin'
,
'admin'
));
define
(
'SECTION_PLUGINTYPE'
,
'core'
);
...
...
htdocs/admin/extensions/templates.php
View file @
a54e7cbc
...
...
@@ -27,8 +27,7 @@
define
(
'INTERNAL'
,
1
);
define
(
'ADMIN'
,
1
);
define
(
'MENUITEM'
,
'configextensions'
);
define
(
'SUBMENUITEM'
,
'templatesadmin'
);
define
(
'MENUITEM'
,
'configextensions/templatesadmin'
);
require
(
dirname
(
dirname
(
dirname
(
__FILE__
)))
.
'/init.php'
);
define
(
'TITLE'
,
get_string
(
'templatesadmin'
,
'admin'
));
define
(
'SECTION_PLUGINTYPE'
,
'core'
);
...
...
htdocs/admin/site/files.php
View file @
a54e7cbc
...
...
@@ -26,8 +26,7 @@
define
(
'INTERNAL'
,
1
);
define
(
'ADMIN'
,
1
);
define
(
'MENUITEM'
,
'configsite'
);
define
(
'SUBMENUITEM'
,
'adminfiles'
);
define
(
'MENUITEM'
,
'configsite/adminfiles'
);
define
(
'SECTION_PLUGINTYPE'
,
'core'
);
define
(
'SECTION_PLUGINNAME'
,
'admin'
);
define
(
'SECTION_PAGE'
,
'adminfiles'
);
...
...
htdocs/admin/site/getmenuitems.json.php
View file @
a54e7cbc
...
...
@@ -35,12 +35,11 @@ $public = (int) param_boolean('public');
$result
=
array
();
//$menuitems = get_records_array('site_menu','public',$public,'displayorder');
$prefix
=
get_config
(
'dbprefix'
);
$menuitems
=
get_records_sql_array
(
'
SELECT
s.*, a.title AS filename
FROM
'
.
$prefix
.
'
site_menu s
LEFT OUTER JOIN
'
.
$prefix
.
'
artefact a ON s.file = a.id
FROM
{
site_menu
}
s
LEFT OUTER JOIN
{
artefact
}
a ON s.file = a.id
WHERE
s.public = '
.
$public
.
'
ORDER BY s.displayorder'
,
null
);
...
...
htdocs/admin/site/menu.php
View file @
a54e7cbc
...
...
@@ -26,9 +26,7 @@
define
(
'INTERNAL'
,
1
);
define
(
'ADMIN'
,
1
);
define
(
'MENUITEM'
,
'configsite'
);
define
(
'SUBMENUITEM'
,
'sitemenu'
);
define
(
'SUBMENUITEM'
,
'sitepages'
);
define
(
'MENUITEM'
,
'configsite/sitemenu'
);
define
(
'SECTION_PLUGINTYPE'
,
'core'
);
define
(
'SECTION_PLUGINNAME'
,
'admin'
);
define
(
'SECTION_PAGE'
,
'sitemenu'
);
...
...
htdocs/admin/site/networking.php
View file @
a54e7cbc
...
...
@@ -26,8 +26,7 @@
define
(
'INTERNAL'
,
1
);
define
(
'ADMIN'
,
1
);
define
(
'MENUITEM'
,
'configsite'
);
define
(
'SUBMENUITEM'
,
'networking'
);
define
(
'MENUITEM'
,
'configsite/networking'
);
require
(
dirname
(
dirname
(
dirname
(
__FILE__
)))
.
'/init.php'
);
require_once
(
get_config
(
'docroot'
)
.
'api/xmlrpc/lib.php'
);
...
...
@@ -60,6 +59,11 @@ $networkingform = pieform(
'name'
=>
'networkingform'
,
'jsform'
=>
true
,
'elements'
=>
array
(
'wwwroot'
=>
array
(
'type'
=>
'html'
,
'title'
=>
get_string
(
'wwwroot'
,
'admin'
),
'value'
=>
get_config
(
'wwwroot'
)
),
'pubkey'
=>
array
(
'type'
=>
'html'
,
'title'
=>
get_string
(
'publickey'
,
'admin'
),
...
...
htdocs/admin/site/options.php
View file @
a54e7cbc
...
...
@@ -26,8 +26,7 @@
define
(
'INTERNAL'
,
1
);
define
(
'ADMIN'
,
1
);
define
(
'MENUITEM'
,
'configsite'
);
define
(
'SUBMENUITEM'
,
'siteoptions'
);
define
(
'MENUITEM'
,
'configsite/siteoptions'
);
require
(
dirname
(
dirname
(
dirname
(
__FILE__
)))
.
'/init.php'
);
require_once
(
'pieforms/pieform.php'
);
...
...
htdocs/admin/site/pages.php
View file @
a54e7cbc
...
...
@@ -26,8 +26,7 @@
define
(
'INTERNAL'
,
1
);
define
(
'ADMIN'
,
1
);
define
(
'MENUITEM'
,
'configsite'
);
define
(
'SUBMENUITEM'
,
'sitepages'
);
define
(
'MENUITEM'
,
'configsite/sitepages'
);
define
(
'SECTION_PLUGINTYPE'
,
'core'
);
define
(
'SECTION_PLUGINNAME'
,
'admin'
);
define
(
'SECTION_PAGE'
,
'sitepages'
);
...
...
htdocs/admin/users/admins.php
View file @
a54e7cbc
...
...
@@ -28,8 +28,7 @@
// here might need to be fixed there too.
define
(
'INTERNAL'
,
1
);
define
(
'ADMIN'
,
1
);
define
(
'MENUITEM'
,
'configusers'
);
define
(
'SUBMENUITEM'
,
'adminusers'
);
define
(
'MENUITEM'
,
'configusers/adminusers'
);
require
(
dirname
(
dirname
(
dirname
(
__FILE__
)))
.
'/init.php'
);
define
(
'TITLE'
,
get_string
(
'adminusers'
,
'admin'
));
define
(
'SECTION_PLUGINTYPE'
,
'core'
);
...
...
@@ -65,18 +64,17 @@ $form = array(
function
adminusers_submit
(
Pieform
$form
,
$values
)
{
global
$SESSION
;
$table
=
get_config
(
'dbprefix'
)
.
'usr'
;
db_begin
();
execute_sql
(
'UPDATE
'
.
$table
.
'
execute_sql
(
'UPDATE
{usr}
SET admin = 0
WHERE admin = 1'
);
execute_sql
(
'UPDATE
'
.
$table
.
'
execute_sql
(
'UPDATE
{usr}
SET admin = 1
WHERE id IN ('
.
join
(
','
,
$values
[
'users'
])
.
')'
);
execute_sql
(
'DELETE FROM
'
.
get_config
(
'dbprefix'
)
.
'
usr_activity_preference
WHERE activity IN (SELECT name FROM
'
.
get_config
(
'dbprefix'
)
.
'
activity_type
WHERE admin = 1
)
execute_sql
(
'DELETE FROM
{
usr_activity_preference
}
WHERE activity IN (SELECT name FROM
{
activity_type
}
WHERE admin = 1)
AND usr NOT IN ('
.
join
(
','
,
$values
[
'users'
])
.
')'
);
db_commit
();
$SESSION
->
add_ok_msg
(
get_string
(
'adminusersupdated'
,
'admin'
));
...
...
htdocs/admin/users/institutions.php
View file @
a54e7cbc
...
...
@@ -25,8 +25,7 @@
*/
define
(
'INTERNAL'
,
1
);
define
(
'ADMIN'
,
1
);
define
(
'MENUITEM'
,
'configusers'
);
define
(
'SUBMENUITEM'
,
'institutions'
);
define
(
'MENUITEM'
,
'configusers/institutions'
);
require
(
dirname
(
dirname
(
dirname
(
__FILE__
)))
.
'/init.php'
);
define
(
'TITLE'
,
get_string
(
'institutions'
,
'admin'
));
define
(
'SECTION_PLUGINTYPE'
,
'core'
);
...
...
@@ -163,6 +162,7 @@ if ($institution || $add) {
'instancestring'
=>
implode
(
','
,
$instancearray
),
'institution'
=>
$institution
,
'help'
=>
true
,
'ignore'
=>
count
(
$authtypes
)
==
0
),
'registerallowed'
=>
array
(
'type'
=>
'checkbox'
,
...
...
@@ -197,7 +197,7 @@ if ($institution || $add) {
.
get_help_icon
(
'core'
,
'admin'
,
'institution'
,
'lockedfields'
)
.
'</th></tr>'
)
);
);
foreach
(
ArtefactTypeProfile
::
get_all_fields
()
as
$field
=>
$type
)
{
$elements
[
$field
]
=
array
(
...
...
@@ -224,10 +224,9 @@ if ($institution || $add) {
}
else
{
// Get a list of institutions
$prefix
=
get_config
(
'dbprefix'
);
$institutions
=
get_records_sql_array
(
'SELECT i.name, i.displayname, i.registerallowed, COUNT(u.id) AS hasmembers
FROM
'
.
$prefix
.
'
institution i
LEFT OUTER JOIN
'
.
$prefix
.
'
usr u ON (u.institution = i.name)
FROM
{
institution
}
i
LEFT OUTER JOIN
{
usr
}
u ON (u.institution = i.name)
GROUP BY 1, 2, 3
ORDER BY i.name'
,
array
());
$smarty
->
assign
(
'institutions'
,
$institutions
);
...
...
Prev
1
2
3
4
5
…
11
Next
Write
Preview
Supports
Markdown
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