This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FusionForge".
The branch, master has been updated
via 1a517092523763d53d39ac68005899edb0258bc7 (commit)
via 1999c29ae24e8bf19f6858acc3176d929086cba9 (commit)
via 5721d38c593e1e3ce303dff7b69b110c6fefcf83 (commit)
from cb837e0cd9a3de151e99a1395a4931c9fb6a48fb (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=1a517092523763d53d39ac68005899edb0258bc7
commit 1a517092523763d53d39ac68005899edb0258bc7
Author: Franck Villaume <[email protected]>
Date: Mon May 6 16:19:57 2019 +0200
monitoring user actions: switch to account action mechanism
diff --git a/src/common/account/actions/addmonitoring.php
b/src/common/account/actions/addmonitoring.php
new file mode 100644
index 0000000..c122ec8
--- /dev/null
+++ b/src/common/account/actions/addmonitoring.php
@@ -0,0 +1,45 @@
+<?php
+/**
+ * add monitoring user action
+ *
+ * Copyright 2012, Franck Villaume - TrivialDev
+ * http://fusionforge.org
+ *
+ * This file is part of FusionForge. FusionForge 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 Licence, or (at your option)
+ * any later version.
+ *
+ * FusionForge 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 FusionForge; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+if (!forge_get_config('use_diary')) {
+ exit_disabled('home');
+}
+
+$diary_user = getStringFromRequest('diary_user');
+$diary_user_object = user_get_object($diary_user);
+if ($diary_user_object && is_object($diary_user_object) &&
$diary_user_object->isActive()) {
+ $result = db_query_params ('SELECT * FROM user_diary_monitor WHERE
user_id = $1 AND monitored_user = $2;', array(user_getid(), $diary_user));
+ if (!$result || db_numrows($result) < 1) {
+ $result = db_query_params ('INSERT INTO user_diary_monitor
(monitored_user, user_id) VALUES ($1, $2)', array($diary_user, user_getid ()));
+ if (!$result) {
+ $error_msg = _('Error')._(': ')._('inserting into
user_diary_monitor');
+ } else {
+ $feedback = sprintf(_('User %s is now being
monitored.'), $diary_user_object->getUnixname());
+ }
+ } else {
+ $warning_msg = sprintf(_('User %s already monitored'),
$diary_user_object->getUnixname());
+ }
+} else {
+ $error_msg = _('No user to monitor selected.');
+}
+session_redirect('/account/');
diff --git a/src/common/account/actions/deletemonitoring.php
b/src/common/account/actions/deletemonitoring.php
new file mode 100644
index 0000000..73fd997
--- /dev/null
+++ b/src/common/account/actions/deletemonitoring.php
@@ -0,0 +1,40 @@
+<?php
+/**
+ * delete monitoring user action
+ *
+ * Copyright 2012, Franck Villaume - TrivialDev
+ * http://fusionforge.org
+ *
+ * This file is part of FusionForge. FusionForge 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 Licence, or (at your option)
+ * any later version.
+ *
+ * FusionForge 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 FusionForge; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+if (!forge_get_config('use_diary')) {
+ exit_disabled('home');
+}
+
+$diary_user = getStringFromRequest('diary_user');
+$diary_user_object = user_get_object($diary_user);
+if ($diary_user_object && is_object($diary_user_object)) {
+ $result = db_query_params ('DELETE FROM user_diary_monitor WHERE
user_id = $1 AND monitored_user = $2', array(user_getid(), $diary_user));
+ if (!$result) {
+ $error_msg = _('Error')._(': ')._('deleting into
user_diary_monitor');
+ } else {
+ $feedback = _('Monitoring Stopped');
+ }
+} else {
+ $error_msg = _('No user to monitor selected.');
+}
+session_redirect('/account/');
diff --git a/src/common/include/user_profile.php
b/src/common/include/user_profile.php
index 8fc5407..67636c1 100644
--- a/src/common/include/user_profile.php
+++ b/src/common/include/user_profile.php
@@ -143,17 +143,17 @@ function user_personal_information($user, $compact =
false, $title = false) {
$subtable .= $HTML->multiTableRow(array(), $subcells);
if (forge_get_config('use_diary') && session_loggedin() &&
($user->getID() != user_getid())) {
if ($user->isMonitoredBy(user_getid())) {
- $option = 'stop';
+ $action = 'deletemonitoring';
$titleMonitor = _('Stop monitoring this user');
$image = $HTML->getStopMonitoringPic($titleMonitor, '');
} else {
- $option = 'start';
+ $action = 'addmonitoring';
$titleMonitor = _('Start monitoring this user');
$image = $HTML->getStartMonitoringPic($titleMonitor,
'');
}
$subcells = array();
$subcells[][] = $titleMonitor;
- $subcells[][] =
util_make_link('/developer/monitor.php?diary_user='.$user->getID(), $image,
array('title' => $titleMonitor));
+ $subcells[][] =
util_make_link('/account/?action='.$action.'&diary_user='.$user->getID(),
$image, array('title' => $titleMonitor));
$subtable .= $HTML->multiTableRow(array(), $subcells);
}
$subtable .= $HTML->listTableBottom();
diff --git a/src/www/developer/monitor.php b/src/www/developer/monitor.php
deleted file mode 100644
index 782a277..0000000
--- a/src/www/developer/monitor.php
+++ /dev/null
@@ -1,84 +0,0 @@
-<?php
-/**
- * Monitor Diary Page
- *
- * Copyright 1999-2001 (c) VA Linux Systems
- * Copyright (C) 2012 Alain Peyrat - Alcatel-Lucent
- * Copyright 2014, Franck Villaume - TrivialDev
- *
- * This file is part of FusionForge. FusionForge 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 Licence, or (at your option)
- * any later version.
- *
- * FusionForge 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 FusionForge; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-require_once '../env.inc.php';
-require_once $gfcommon.'include/pre.php';
-
-global $HTML;
-
-if (!forge_get_config('use_diary')) {
- exit_disabled('home');
-}
-
-if (!session_loggedin()) {
- exit_not_logged_in();
-} else {
- /*
- User obviously has to be logged in to monitor
- */
- $diary_user = getStringFromRequest('diary_user');
- if ($diary_user) {
- /*
- First check to see if they are already monitoring
- If they are, unmonitor by deleting row.
- If they are NOT, then insert a row into the db
- */
-
- site_user_header(array('title'=>_('Monitor a User')));
-
- $result = db_query_params ('SELECT * FROM user_diary_monitor
WHERE user_id=$1 AND monitored_user=$2;',
- array (user_getid(),
- $diary_user));
- if (!$result || db_numrows($result) < 1) {
- /*
- User is not already monitoring thread, so
- insert a row so monitoring can begin
- */
- $result = db_query_params ('INSERT INTO
user_diary_monitor (monitored_user,user_id) VALUES ($1,$2)',
- array ($diary_user,
- user_getid ()));
-
- if (!$result) {
- echo $HTML->error_msg(_('Error inserting into
user_diary_monitor'));
- } else {
- echo $HTML->feedback(_('User is now being
monitored'));
- echo '<p>' . _("You will now be emailed this
user's diary entries.") . '</p>';
- echo '<p>' . _('To turn off monitoring, simply
click the <strong>Monitor user</strong> link again.') . '</p>';
- }
-
- } else {
- $result = db_query_params ('DELETE FROM
user_diary_monitor WHERE user_id=$1 AND monitored_user=$2',
- array (user_getid(),
- $diary_user));
- echo $HTML->feedback(_('Monitoring Stopped'));
- echo _('You will not receive any more emails from this
user');
-
- }
- $HTML->footer();
- } else {
- $HTML->header(array('title'=>_('Error: Choose a User To Monitor
First')));
- $HTML->footer();
- }
-
-}
diff --git a/src/www/users b/src/www/users
index 619673e..cecdeb8 100644
--- a/src/www/users
+++ b/src/www/users
@@ -87,15 +87,15 @@ if (!$user || !is_object($user) || $user->isError() ||
!$user->isActive()) {
$title = '<i>'.$username.'</i> '._('Profile');
if (forge_get_config('use_diary') && session_loggedin() &&
($user->getID() != user_getid())) {
if ($user->isMonitoredBy(user_getid())) {
- $option = 'stop';
+ $action = 'deletemonitoring';
$titleMonitor = _('Stop monitoring this user');
$image =
$HTML->getStopMonitoringPic($titleMonitor, '');
} else {
- $option = 'start';
+ $action = 'addmonitoring';
$titleMonitor = _('Start monitoring this user');
$image =
$HTML->getStartMonitoringPic($titleMonitor, '');
}
- $title .=
util_make_link('/developer/monitor.php?diary_user='.$user->getID(), $image,
array('title' => $titleMonitor));
+ $title .=
util_make_link('/account/?action='.$action.'&diary_user='.$user->getID(),
$image, array('title' => $titleMonitor));
}
$HTML->header(array('title' => $title));
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=1999c29ae24e8bf19f6858acc3176d929086cba9
commit 1999c29ae24e8bf19f6858acc3176d929086cba9
Author: Franck Villaume <[email protected]>
Date: Mon May 6 16:18:55 2019 +0200
fix html warning. span cannot be empty
diff --git a/src/www/include/user_home.php b/src/www/include/user_home.php
index 0d7d160..f97db2a 100644
--- a/src/www/include/user_home.php
+++ b/src/www/include/user_home.php
@@ -118,10 +118,10 @@ if (count ($projects) < 1) {
print "\n";
if (forge_check_perm_for_user ($user, 'project_admin',
$p->getID())) {
- print '<span rev="doap:maintainer"
resource="#me"></span>';
+ echo html_e('div', array('rev' => 'doap:maintainer',
'resource' => '#me'));
}
else {
- print '<span rev="doap:developer"
resource="#me"></span>';
+ echo html_e('div', array('rev' => 'doap:developer',
'resource' => '#me'));
}
echo $sioc_has_function_close."\n"; // sioc:has_function
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=5721d38c593e1e3ce303dff7b69b110c6fefcf83
commit 5721d38c593e1e3ce303dff7b69b110c6fefcf83
Author: Franck Villaume <[email protected]>
Date: Mon May 6 16:18:45 2019 +0200
fix html warning. span cannot be empty
diff --git a/src/common/widget/Widget_UserhomeProjectInformation.class.php
b/src/common/widget/Widget_UserhomeProjectInformation.class.php
index cde067a..3402131 100644
--- a/src/common/widget/Widget_UserhomeProjectInformation.class.php
+++ b/src/common/widget/Widget_UserhomeProjectInformation.class.php
@@ -81,10 +81,10 @@ class Widget_UserhomeProjectInformation extends Widget {
print "\n";
if (forge_check_perm_for_user ($user, 'project_admin',
$p->getID())) {
- print '<span rev="doap:maintainer"
resource="#me"></span>';
+ echo html_e('div', array('rev' =>
'doap:maintainer', 'resource' => '#me'));
}
else {
- print '<span rev="doap:developer"
resource="#me"></span>';
+ echo html_e('div', array('rev' =>
'doap:developer', 'resource' => '#me'));
}
echo $sioc_has_function_close."\n"; //
sioc:has_function
-----------------------------------------------------------------------
Summary of changes:
src/common/account/actions/addmonitoring.php | 45 ++++++++++++
.../{deletesshkey.php => deletemonitoring.php} | 23 +++---
src/common/include/user_profile.php | 6 +-
.../Widget_UserhomeProjectInformation.class.php | 4 +-
src/www/developer/monitor.php | 84 ----------------------
src/www/include/user_home.php | 4 +-
src/www/users | 6 +-
7 files changed, 70 insertions(+), 102 deletions(-)
create mode 100644 src/common/account/actions/addmonitoring.php
copy src/common/account/actions/{deletesshkey.php => deletemonitoring.php}
(58%)
delete mode 100644 src/www/developer/monitor.php
hooks/post-receive
--
FusionForge
_______________________________________________
Fusionforge-commits mailing list
[email protected]
http://lists.fusionforge.org/cgi-bin/mailman/listinfo/fusionforge-commits