Is there a way to check who has, and who has not, approved the agreement?
Otherwise I would like that to be a feature request.

Thanks, Jesper

Comments

yuriy.babenko’s picture

Category: support » feature

There is currently no such functionality, but it would be pretty easy to setup a page to show this. I'll add this in the future.

For the time being you can query the 'agreement' database table - users who have accepted the agreement will be listed there.

kchrisfrog’s picture

Hey,

I am not very good a PHP or MySQL so this will NOT be the best way of doing this but if you create a page and add this code to the page it will show you which users have agreed. We wanted to start using this staright away so had to write a quick hack.

$dbhost = 'localhost';
$dbuser = 'YOUR-DATABASE-USER-NAME';
$dbpass = 'YOUR-DATABASE-PASSWORD';

$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');

$dbname = 'YOUR-DRUPAL-DATABASE-NAME';
mysql_select_db($dbname);

// Create an table with the correct information 

$result = mysql_query("SELECT * FROM agreement WHERE agreed = 1") 
or die(mysql_error());  

echo "<table border='1'>";
echo "<b><u>Agreed</b></u>";
echo "<tr> <th>Name</th> <th>Agreed</th> </tr>";
// keeps getting the next row until there are no more to get
while($row = mysql_fetch_array( $result )) {
        // Get the name of the UID
        $uid = $row['uid'];
	$resultfetch = mysql_query("SELECT * FROM users WHERE uid=$uid") or die(mysql_error());  
        $row = mysql_fetch_array( $resultfetch );
	// Print out the contents of each row into a table
	echo "<tr><td>"; 
        echo $row['name'];
        echo "</td><td>";
        echo "<img src=\"URL-TO-YOUR-GREEN-TICK/images/GREENTICK.JPG\" alt=\"Green Tick\" width=\"20\" height=\"20\">";
	echo "</tr></td>"; 
} 
echo "</table>";

This may brake your site so please test first!!!!

Thanks

Chris

charos’s picture

This seems a good starting point for this. I wonder if the maintainers are interested in such implementation. Further more I would like to see a timestamp of the user's acceptance (date/time the user accepted the agreement). Wishful thinking I guess, just planting seeds!

pagaille’s picture

charos - you read my mind! I'm working on this feature and will be rolling it out within the next couple of days. Problem is, all existing agreements will have a blank agreement date, so they will show up as "Unknown" in the view.

charos’s picture

That's great!!! The blank agreement date makes perfect sense for existing users. Not really a problem- time cannot be patched!!

pagaille’s picture

Version: 6.x-1.1 » 6.x-1.x-dev
Status: Active » Fixed

This has been fixed in the 6.x-1.x-dev release. There is now a default /admin/user/agreements view that displays all existing agreements, sorted by username. Be sure to run update.php after upgrading to this dev release.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

vako’s picture

This works only with version 6.x-2.x and above.