Changeset 59123ec


Ignore:
Timestamp:
08/28/14 07:51:51 (5 months ago)
Author:
Kris Moore <kris@…>
Branches:
master, releng/10.1, releng/10.1.1
Children:
df27b0b
Parents:
721f8ba
Message:

Fix some bugs installing apps into #system

Location:
src-webui/appweb
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src-webui/appweb/dispatcher

    rf2fa59bb r59123ec  
    1414# origin = www/firefox or other PBI/PKG origin 
    1515# flag = install/delete/info 
    16 # target = #system / <jailname> 
     16# target = __system__ / <jailname> 
    1717 
    1818PATH="$PATH:/usr/local/bin:/usr/local/sbin" 
     
    8484  if [ "$app" == "pbi" ];then 
    8585     cmd="pbi" 
    86      if [ "$target" != "#system" ] ; then 
     86     if [ "$target" != "__system__" ] ; then 
    8787       cmd="$cmd $flag -j $target $origin" 
    8888     else 
     
    9191  elif [ "$app" == "pkg" ];then 
    9292     cmd="pkg" 
    93      if [ "$target" != "#system" ] ; then 
     93     if [ "$target" != "__system__" ] ; then 
    9494       cmd="$cmd -j $target" 
    9595     fi 
     
    111111 
    112112  # If we installed something into a jail, refresh them 
    113   if [ "$target" != "#system" ] ; then 
     113  if [ "$target" != "__system__" ] ; then 
    114114     pc-systemflag WARDENUPDATE SUCCESS 
    115115  fi 
     
    203203  sname="$3" 
    204204  sscript="$4" 
    205   if [ "$5" != "#system" ] ; then 
     205  if [ "$5" != "__system__" ] ; then 
    206206     jid="$5" 
    207207     jdir=`jls | grep " ${jid} " | awk '{print $4}'` 
  • src-webui/appweb/share/html/include/functions.php

    ra5afab4 r59123ec  
    4444function queueInstallApp() 
    4545{ 
     46   global $jail; 
     47   global $jailUrl; 
     48 
    4649   $app = $_GET['installApp']; 
    4750   $type = $_GET['installAppCmd']; 
    48    $target = $_GET['installAppTarget']; 
    49    if ( ! empty($app) and ! empty($type) and ! empty($target) ) 
    50       run_cmd("queue $type $app install $target"); 
    51  
     51 
     52   if ( ! empty($app) and ! empty($type) and ! empty($jail) ) 
     53      run_cmd("queue $type $app install $jailUrl"); 
     54  
    5255   // Now we can remove those values from the URL 
    5356   $newUrl=http_build_query($_GET); 
     
    5760   $newUrl=str_replace("&installAppCmd=$type", "", $newUrl); 
    5861   $newUrl=str_replace("installAppCmd=$type", "", $newUrl); 
    59    $newUrl=str_replace("&installAppTarget=$target", "", $newUrl); 
    60    $newUrl=str_replace("installAppTarget=$target", "", $newUrl); 
    6162   hideurl("?".$newUrl); 
    6263} 
     
    6465function queueDeleteApp() 
    6566{ 
     67   global $jail; 
     68   global $jailUrl; 
     69 
    6670   $app = $_GET['deleteApp']; 
    6771   $type = $_GET['deleteAppCmd']; 
    68    $target = $_GET['deleteAppTarget']; 
    69    if ( ! empty($app) and ! empty($type) and ! empty($target) ) 
    70       run_cmd("queue $type $app delete $target"); 
     72 
     73   if ( ! empty($app) and ! empty($type) and ! empty($jail) ) 
     74      run_cmd("queue $type $app delete $jailUrl"); 
    7175 
    7276   // Now we can remove those values from the URL 
     
    7781   $newUrl=str_replace("&deleteAppCmd=$type", "", $newUrl); 
    7882   $newUrl=str_replace("deleteAppCmd=$type", "", $newUrl); 
    79    $newUrl=str_replace("&deleteAppTarget=$target", "", $newUrl); 
    80    $newUrl=str_replace("deleteAppTarget=$target", "", $newUrl); 
    8183   hideurl("?".$newUrl); 
    8284} 
  • src-webui/appweb/share/html/js/appcafe.js

    r13270a4 r59123ec  
    22    if (confirm("Are you sure you want to delete " + appname + "?") == true) { 
    33        var newURL = window.location.pathname + window.location.search; 
    4         window.location.href = newURL + "&deleteApp=" + origin + "&deleteAppCmd=" + cmd + "&deleteAppTarget=" + target; 
     4        window.location.href = newURL + "&deleteApp=" + origin + "&deleteAppCmd=" + cmd; 
    55    } 
    66} 
     
    99    if (confirm("Are you sure you want to install " + appname + "?") == true) { 
    1010        var newURL = window.location.pathname + window.location.search; 
    11         window.location.href = newURL + "&installApp=" + origin + "&installAppCmd=" + cmd + "&installAppTarget=" + target; 
     11        window.location.href = newURL + "&installApp=" + origin + "&installAppCmd=" + cmd ; 
    1212    } 
    1313} 
  • src-webui/appweb/share/html/pages/appinfo.php

    r0fcc042 r59123ec  
    1414 
    1515  if ( $jail == "#system" ) 
    16      $output = run_cmd("service $action $sname $sscript #system"); 
     16     $output = run_cmd("service $action $sname $sscript $jailUrl"); 
    1717  else { 
    1818     // Get jail ID 
Note: See TracChangeset for help on using the changeset viewer.