[svn r14418] Check the tool doesn't exist before inserting it

skala
Yannick Warnier 17 years ago
parent 7d0bdf136e
commit 4f00541088
  1. 10
      main/admin/configure_extensions.php

@ -43,6 +43,10 @@ if(isset($_POST['activeExtension'])){
if(!empty($_POST['visio_host']))
{
$tool_table = Database::get_course_table(TABLE_TOOL_LIST,$row['db_name']);
$select = "SELECT id FROM $toos_table WHERE name='".TOOL_VISIO_CONFERENCE."'";
$selectres = api_sql_query($select);
if(Database::num_rows($selectres)<1)
{
$sql = 'INSERT INTO '.$tool_table.' SET
name="'.TOOL_VISIO_CONFERENCE.'",
link="conference/index.php?type=conference",
@ -53,6 +57,11 @@ if(isset($_POST['activeExtension'])){
target="_self",
category="interaction"';
api_sql_query($sql, __FILE__, __LINE__);
}
$select = "SELECT id FROM $toos_table WHERE name='".TOOL_VISIO_CLASSROOM."'";
$selectres = api_sql_query($select);
if(Database::num_rows($selectres)<1)
{
$sql = 'INSERT INTO '.$tool_table.' SET
name="'.TOOL_VISIO_CLASSROOM.'",
link="conference/index.php?type=classroom",
@ -65,6 +74,7 @@ if(isset($_POST['activeExtension'])){
api_sql_query($sql, __FILE__, __LINE__);
}
}
}
$message = get_lang('ServiceActivated');
}

Loading…
Cancel
Save