[svn r13249] little bug fixes inside api.php & checksession.php

skala
Arnaud Ligot 18 years ago
parent 0aa3969e07
commit 684c6c7ceb
  1. 20
      main/webrooms/api.php
  2. 5
      main/webrooms/checksession.php

@ -238,20 +238,20 @@ if ($action == "upload")
continue;
else
{
printf('<file><path>%s</path><title>%s</title><canDelete>%s</canDelete></file>', $i['path'], $i['title'],($canDelete?"true":"false"));
printf('<file><path>%s</path><title>%s</title><canDelete>%s</canDelete></file>', $i['path'],$i['title'],($canDelete?"true":"false"));
}
}
printf("</files><ppts>");
foreach($files as $i) {
// foreach($files as $i) {
// FIXME: Please optimise me !!!
$extension = (strrpos($i['path'],'.')>0 ? substr($i['path'], strrpos($i['path'],'.'),10) : '');
if ($i["filetype"] != "file" || !in_array($extension, $PRESENTATION_EXTENSION))
continue;
else
{
printf('<ppt><path>%s</path><title>%s</title><canDelete>%s</canDelete></ppt>', $i['path'], $i['title'],($canDelete?"true":"false"));
}
}
// $extension = (strrpos($i['path'],'.')>0 ? substr($i['path'], strrpos($i['path'],'.'),10) : '');
// if ($i["filetype"] != "file" || !in_array($extension, $PRESENTATION_EXTENSION))
// continue;
// else
// {
// printf('<ppt><path>%s</path><title>%s</title><canDelete>%s</canDelete></ppt>', $i['path'], $i['title'],($canDelete?"true":"false"));
// }
// }
// printf("<file><realname>fr1</realname><name>fn1</name></file>");
printf("</ppts>");

@ -27,11 +27,12 @@ printf ('<?xml version="1.0" encoding="UTF-8" ?>');
printf('<dokeosobject>');
printf('<courseobject>');
foreach ($_SESSION['_course'] as $key => $val) printf('<%s>%s</%s>',$key,utf8_encode($val),$key);
foreach ($_SESSION['_course'] as $key => $val)
printf('<%s>%s</%s>',$key,utf8_encode($val),$key);
printf('</courseobject>');
printf('<userobject>');
foreach ($_SESSION['_user'] as $key => $val) printf('<%s>%s</%s>',$key,utf8_encode($val),$key);
foreach ($_SESSION['_user'] as $key => $val) if ($key != "auth_source") printf('<%s>%s</%s>',$key,utf8_encode($val),$key);
printf('<sid>%s</sid>', session_id());
printf('<isUploadAllowed>%s</isUploadAllowed>', (CourseManager::get_user_in_course_status($_SESSION['_user']['user_id'], $_SESSION['_course']['sysCode']) == COURSEMANAGER) ? "true" : "false");
printf('</userobject>');

Loading…
Cancel
Save