Example #1
0
# as published by the Free Software Foundation.
#
# Cronus is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Cronus. If not; see <http://www.gnu.org/licenses/>.
/*
*
* Usage Example: /api/proxy/action/vhost/changedomain
*
* passed values:
* port :Port where tenant reside
* subdomain : Tenants subdomain
* domain : Tenants domain
* infraip : Proxy server used by Tenant
* webappip : Tenant server where Tenant reside
*
* Returns: JSON {status:success|fail}
*
*/
include "{$module}/lib/{$action_on}.inc.php";
include "{$module}/{$action_on}/config.php";
$retval = change_domain(param('port'), param('domain'), param('infraip'), param('webappip'), param('subdomain'));
if ($retval) {
    print json_encode(array('status' => 'success'));
} else {
    print json_encode(array('status' => 'fail'));
}
// get db connect 
$data = CData_Layer::create($errors) ;


// get the sess, auth and perm vars
page_open (array("sess" => "phplib_Session_Pre_Auth",
   "auth" => "phplib_Pre_Auth",
   "perm" => "phplib_Perm"));


## do this in every file after the page_open
$perm->check('USER');

if ($perm->have_perm('SUPER'))  {
  change_domain();
}


$header_smarty = get_smarty_header($data, $auth, $perm); 

$smarty = get_smarty(); 
//Check persmissions 

$qdomains = array();

if ($perm->have_perm('SUPER')){
  $qdomains[0] = 'ALL';
  global $adomain;
  if ($FORM_VARS[domain]) {
    $qdomains[0] = $FORM_VARS[domain];
Example #3
0
File: dns.php Project: zcsevcik/edu
                xmlhttp.send(null);
            }
            catch (e) {
                alert(e.toString());
            }

            return false;

        }
        </script>
EOL;
    return $content . xmltransform(XMLDB_DNS, XSLT_DNS);
}
if (isset($_GET['action'])) {
    if ($_GET['action'] == 'chng_dom') {
        echo change_domain($_GET['id'], $_GET['val']);
    } else {
        if ($_GET['action'] == 'chng_name') {
            echo change_domain_name($_GET['id'], $_GET['val']);
        } else {
            if ($_GET['action'] == 'chng_4') {
                echo change_domain_4($_GET['id'], $_GET['val']);
            } else {
                if ($_GET['action'] == 'chng_6') {
                    echo change_domain_6($_GET['id'], $_GET['val']);
                }
            }
        }
    }
    exit;
} else {