Entries tagged room

MRBS: Show email address instead of username

Posted on 17. Oktober 2013 Comments

Oftentimes people use MRBS with an LDAP directory and the users have identifiers that don’t fit their real names. MRBS uses these identifiers publicly to show who reserved a room.

I see 2 problems here: if the MRBS website is public, attackers get valid usernames(although this is more obscuring than actually making it more secure), and in case users want to discuss the usage of meeting rooms, they don’t know who to talk to. In my opinion, the email address would be much more helpful.

So I had a look at the sourcecode(v. 1.8.4) and edited the following lines:

file: functions_view.inc
line: 149 ..

// This was the original code
// $tbody .= create_details_row(get_vocab("createdby"), $data['create_by'], $as_html, $class);
// This is what I made out of it
$mail = authLdapGetEmail($data['create_by']);
$tbody .= create_details_row(get_vocab("createdby"), $mail, $as_html, $class); 

Simple MRBS Output from Database

Posted on 17. September 2013 Comments

I wrote a little PHP-script that extracts the most important and current data from MRBS’s MySQL database and just prints them in a simple HTML file. Its not pretty but good for bandwith and clarity. We use it to display information on an energy efficient e-ink screen in front of conference/computer rooms.

$date is set like this:

$date = date("Y-m-d");

The SELECT-statements go like this, where N is the ID of the room(in the database, not what you might call it)

SELECT name,description,from_unixtime(start_time),from_unixtime(end_time) FROM mrbs_entry WHERE from_unixtime(start_time) LIKE '%" . $date . "%' AND room_id = N;

I’m not gonna explain here how to establish a database connection in PHP, but you can have a  look at the whole sourcecode at github 😉

I then cut off the date with substr() because it’s always 10 characters in front of time->(YYYY-MM-DD) and printed it via echo. This is the simple version, there is a version with tables on github.

while($row=mysql_fetch_row($qry01)) {
echo "- <strong>Room</strong> 01 | <strong>Desc:</strong>" . $row[0]." - ".$row[1]." |  <strong>Time:</strong> ". substr($row[2],10) . " - " . substr($row[3],10) . " <br />";
}

update: I wrote another version that prints JSON objects which can be parsed on the other side. For easier parsing(e.g. if everything is in one String) I numbered them:

$jsonarray = array('begin' . $i => substr($row[2],11, 5), 'end' . $i => substr($row[3],11,5), 'name' . $i => $row['name'], 'description' . $i =>  $row['description']);

You’ll find the whole thing on github.