exit;
}
require_once $SYSTEM_ROOT . '/core/include/init.inc';
$root_user = $GLOBALS['SQ_SYSTEM']->am->getSystemAsset('root_user');
// log in as root
if (!$GLOBALS['SQ_SYSTEM']->setCurrentUser($root_user)) {
    echo "ERROR: Failed logging in as root user\n";
    exit(1);
}
//end if
$fbm = $GLOBALS['SQ_SYSTEM']->am->getSystemAsset('funnelback_manager');
$collections = $fbm->getCollections();
foreach ($collections as $index => $collection) {
    $file_paths = array();
    $all_good = TRUE;
    printCollection($index, $collection['name']);
    $data_path = $fbm->getCollectionDataPath($index) . '/conf/';
    $file_paths['contextual_navigation.cfg'] = 'fluster.cfg';
    $file_paths['query_expansion.cfg'] = 'synonyms.cfg';
    $file_paths['best_bets.cfg'] = 'featured_pages.cfg';
    foreach ($file_paths as $new_path => $file_path) {
        if (file_exists($data_path . $file_path)) {
            if (!copy($data_path . $file_path, $data_path . $new_path)) {
                bam($data_path . $file_path);
                $all_good = FALSE;
            }
        }
    }
    if ($all_good) {
        printUpdateStatus('OK');
    } else {
Пример #2
0
                             goURL('database_lists.php');
                         }
                     }
                 }
             }
         }
         $notice .= '</div>';
     }
     echo '<div class="title">' . $title . '</div>';
     echo $notice;
     echo '<div class="list">
             <form action="database_create.php" method="post">
                 <span class="bull">&bull;</span>Tên database:<br/>
                 <input type="text" name="name" value="' . $name . '" size="18"/><br/>
                 <span class="bull">&bull;</span>Mã hóa - Đối chiếu:<br/>
                 <select name="collection">' . printCollection(stripslashes($collection)) . '</select><br/>
                 <input type="submit" name="submit" value="Tạo"/>
             </form>
         </div>
         <div class="title">Chức năng</div>
         <ul class="list">
             <li><img src="icon/database.png"/> <a href="database_lists.php">Danh sách database</a></li>
         </ul>';
 } else {
     if (IS_CONNECT && !IS_DATABASE_ROOT) {
         echo '<div class="title">' . $title . '</div>
         <div class="list">Bạn đang kết nối tới một database không thể vào danh sách database</div>
         <div class="title">Chức năng</div>
         <ul class="list">
             <li><img src="icon/disconnect.png"/> <a href="database_disconnect.php">Ngắt kết nối database</a></li>
         </ul>';