Skip to content
GitLab
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
44c98b7a
Commit
44c98b7a
authored
Jul 07, 2009
by
Richard Mansfield
Browse files
Add events for friend requests, etc.
parent
28d7b655
Changes
6
Hide whitespace changes
Inline
Side-by-side
htdocs/lib/db/upgrade.php
View file @
44c98b7a
...
...
@@ -1106,6 +1106,13 @@ function xmldb_core_upgrade($oldversion=0) {
};
}
if
(
$oldversion
<
2009070700
)
{
foreach
(
array
(
'addfriend'
,
'removefriend'
,
'addfriendrequest'
,
'removefriendrequest'
)
as
$eventtype
)
{
$event
=
(
object
)
array
(
'name'
=>
$eventtype
);
ensure_record_exists
(
'event_type'
,
$event
,
$event
);
}
}
return
$status
;
}
...
...
htdocs/lib/user.php
View file @
44c98b7a
...
...
@@ -1208,6 +1208,9 @@ function acceptfriend_submit(Pieform $form, $values) {
insert_record
(
'usr_friend'
,
$f
);
db_commit
();
handle_event
(
'addfriend'
array
(
'user'
=>
$f
->
usr2
,
'friend'
=>
$f
->
usr1
));
$SESSION
->
add_ok_msg
(
get_string
(
'friendformacceptsuccess'
,
'group'
));
redirect
(
'/user/view.php?id='
.
$values
[
'id'
]);
}
...
...
@@ -1238,6 +1241,9 @@ function addfriend_submit(Pieform $form, $values) {
require_once
(
'activity.php'
);
activity_occurred
(
'maharamessage'
,
$n
);
handle_event
(
'addfriend'
array
(
'user'
=>
$f
->
usr2
,
'friend'
=>
$f
->
usr1
));
$SESSION
->
add_ok_msg
(
get_string
(
'friendformaddsuccess'
,
'group'
,
display_name
(
$user
)));
redirect
(
'/user/view.php?id='
.
$values
[
'id'
]);
}
...
...
htdocs/lib/version.php
View file @
44c98b7a
...
...
@@ -27,7 +27,7 @@
defined
(
'INTERNAL'
)
||
die
();
$config
=
new
StdClass
;
$config
->
version
=
2009070
6
00
;
$config
->
version
=
2009070
7
00
;
$config
->
release
=
'1.2.0alpha3dev'
;
$config
->
minupgradefrom
=
2008040200
;
$config
->
minupgraderelease
=
'1.0.0 (release tag 1.0.0_RELEASE)'
;
...
...
htdocs/user/denyrequest.php
View file @
44c98b7a
...
...
@@ -93,6 +93,9 @@ function denyrequest_submit(Pieform $form, $values) {
}
require_once
(
'activity.php'
);
activity_occurred
(
'maharamessage'
,
$n
);
handle_event
(
'removefriendrequest'
array
(
'owner'
=>
$loggedinid
,
'requester'
=>
$id
));
$SESSION
->
add_ok_msg
(
get_string
(
'friendformrejectsuccess'
,
'group'
));
switch
(
param_alpha
(
'returnto'
,
'myfriends'
))
{
case
'find'
:
...
...
htdocs/user/removefriend.php
View file @
44c98b7a
...
...
@@ -94,6 +94,8 @@ function removefriend_submit(Pieform $form, $values) {
require_once
(
'activity.php'
);
activity_occurred
(
'maharamessage'
,
$n
);
handle_event
(
'removefriend'
array
(
'user'
=>
$loggedinid
,
'friend'
=>
$id
));
$SESSION
->
add_ok_msg
(
get_string
(
'friendformremovesuccess'
,
'group'
,
display_name
(
$id
)));
switch
(
param_alpha
(
'returnto'
,
'myfriends'
))
{
case
'find'
:
...
...
htdocs/user/requestfriendship.php
View file @
44c98b7a
...
...
@@ -99,6 +99,8 @@ function requestfriendship_submit(Pieform $form, $values) {
require_once
(
'activity.php'
);
activity_occurred
(
'maharamessage'
,
$n
);
handle_event
(
'addfriendrequest'
array
(
'requester'
=>
$loggedinid
,
'owner'
=>
$id
));
$SESSION
->
add_ok_msg
(
get_string
(
'friendformrequestsuccess'
,
'group'
,
display_name
(
$id
)));
switch
(
param_alpha
(
'returnto'
,
'myfriends'
))
{
case
'find'
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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