blob: aa2aac13efb788d9000c1bd2db4be9297a7a4682 [file] [log] [blame]
gobrienad11d892007-12-19 08:33:25 +00001<?php
2/*******************************************************************************
3 * Copyright (c) 2007 Eclipse Foundation and others.
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License v1.0
6 * which accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
8 *
9 * Contributors:
10 * Paul Colton (Aptana)- initial API and implementation
11
12*******************************************************************************/
13require_once("cb_global.php");
14
15
gobrienda3a4502008-01-28 23:43:26 +000016
17if(!isset($_SESSION['project'])){
18 return array();
19}
20
gobrien1c01c752008-01-10 18:34:31 +000021$query = "select
gobrien38c02552008-01-23 22:52:02 +000022 DISTINCT files.version,files.project_id
gobrien1c01c752008-01-10 18:34:31 +000023 from
24 project_versions,
25 files
26 where
27 files.project_id = project_versions.project_id
28 and
29 files.version = project_versions.version
30 and
31 project_versions.is_active = 1
32 and
33 project_versions.project_id = '".addslashes($_SESSION['project'])."'";
gobrienad11d892007-12-19 08:33:25 +000034
35//print $query."\n";
36
37$res = mysql_query($query,$dbh);
38
39while($line = mysql_fetch_array($res, MYSQL_ASSOC)){
40 $ret = Array();
41 $ret['version'] = $line['version'];
gobrienda3a4502008-01-28 23:43:26 +000042 if(isset($_SESSION['version']) and $line['version'] == $_SESSION['version']){
gobriene4a39c82008-01-11 00:06:14 +000043 $ret['current'] = true;
44 }
gobrienad11d892007-12-19 08:33:25 +000045 $return[] = $ret;
46}
47
48print json_encode($return);
49
50?>