return send_exit_single('user role authorize failed (fetch auth node).'); } $sql = "INSERT INTO authorize(flag, company_id, auth_role_id, auth_node_id)VALUE(1, :company_id, :auth_role_id, :auth_node_id)"; $prepared = $pdo->prepare($sql); $prepared->bindParam(':company_id', $company_id); $prepared->bindParam(':auth_role_id', $auth_role_id); $prepared->bindParam(':auth_node_id', $auth_node['id']); if (!$prepared->execute()) { rollback($pdo); return send_exit_single('user role authorize failed (authorize).'); } // 创建session表 $pdo->exec("CREATE TABLE IF NOT EXISTS `session` (\n `session_id` varchar(255) NOT NULL,\n `session_expire` int(11) NOT NULL,\n `session_data` blob,\n UNIQUE KEY `session_id` (`session_id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8;"); // 写应用表 $sql = "INSERT INTO app(alias, requirements)VALUES(:alias, :requirements)"; $prepared = $pdo->prepare($sql); foreach ($apps as $alias => $app_config) { $requirements = $app_config['requirements']; $prepared->bindParam(':alias', $alias); $prepared->bindParam(':requirements', $requirements); $prepared->execute(); } display_loading('initialize company and super-user', 5); file_put_contents(ENTRY_PATH . '/Data/install.lock', time()); echo "\n\n"; echo file_get_contents(INSTALL_PATH . '/Complete.md'); echo "\nYour login info: \n"; echo "Company sign id: 10000\n"; echo "Login name: " . $user_info['login'] . "\n"; echo "Password: "******"\n\n"; exit;
display_error('Unable to compute image signature'); return FALSE; } display_signature_ok(); save_signature($url, get_client_info(), $md5, $cvec); return TRUE; } $url = trim(@$_POST['url']); if (empty($url)) { display_form(); exit(0); } if (strlen($url) > MAX_URL_SIZE || preg_match('£^http://([a-z0-9-]+[.])+[a-z]{2,}/.£i', $url) <= 0) { display_form(); display_error('Invalid URL, must be http://...'); exit(1); } display_loading(); $md5 = FALSE; $cvec = FALSE; if (record_url($url, $md5, $cvec) !== TRUE) { exit(1); } $urls = find_similar_pictures($md5, $cvec); unset($cvec); display_form(); display_similar_pictures($urls); ?> </body> </html>