Changeset 5741


Ignorieren:
Zeitstempel:
08.09.2010 20:06:14 (vor 7 Jahren)
Autor:
oliver
Nachricht:
  • Fix reg_from_external patch (by MaxMuster)
    • enable for 7570
    • refs #609
Ort:
trunk
Dateien:
2 bearbeitet

Legende:

Unverändert
Hinzugefügt
Entfernt
  • trunk/Config.in

    r5737 r5741  
    822822config FREETZ_ADD_REGEXT_GUI 
    823823    bool "Patch GUI to enable external SIP connections" 
    824     depends on ( \ 
    825         FREETZ_TYPE_FON_WLAN_7240 || \ 
    826         FREETZ_TYPE_FON_WLAN_7270 || \ 
    827         FREETZ_TYPE_FON_WLAN_7270_V3 || \ 
    828         (FREETZ_TYPE_FON_WLAN_7170 && ! FREETZ_TYPE_LABOR_DSL) \ 
     824    depends on \ 
     825        FREETZ_TYPE_FON_WLAN_7570 || \ 
     826        ( \ 
     827            FREETZ_TYPE_FON_WLAN_7170 || \ 
     828            FREETZ_TYPE_FON_WLAN_7240 || \ 
     829            FREETZ_TYPE_FON_WLAN_7270 || \ 
     830            FREETZ_TYPE_FON_WLAN_7270_V3 \ 
    829831        ) && FREETZ_TYPE_LANG_DE 
    830832    default n 
  • trunk/patches/550-add_reg_external_in_gui.sh

    r5608 r5741  
    11[ "$FREETZ_ADD_REGEXT_GUI" == "y" ] || return 0 
    2 # own modsed, use --follow-symlink  
    3 # and don't warn if file not found 
    4 # because fon1IPPhone.* files are not allways available; seems easier than something like  
    5 # [ -x ${dir}/fon1IPPhone.<xy> ] && modsed ... 
    62 
    7 modsed() 
    8 { 
    9     if [ -f "$2" ]; then 
    10         echo2 "patching $2" 
    11         sed -i --follow-symlink -e "$1" "$2" 
    12     fi 
    13 } 
    143echo1 "adding GUI switch to set reg_from_outside" 
    154 
    16 DIRSS2PATCH=$(find ${FILESYSTEM_MOD_DIR}/usr/www/ -type d -name fon_config) 
    17 if [ -n "$DIRSS2PATCH" ]; then 
    18     for dir in $DIRSS2PATCH; do 
    19         modsed '/id="uiPostIPPhoneExtNumber"/ a<Input type="hidden" name="voipextension:settings/extension<? echo $var:DeviceIpPhonePort ?>/reg_from_outside" value="" id="uiPostIPPhoneExtRegFromOutside" disabled>' ${dir}/fon_config_End.frm 
    20         modsed '/jslEnable("uiPostIPPhoneExtNumber")/ ajslCopyValue( "uiPostIPPhoneExtRegFromOutside", "uiIPPhoneExtRegFromOutside"); jslEnable("uiPostIPPhoneExtRegFromOutside");' ${dir}/fon_config_End.js 
    21         modsed '/id="uiShowOutgoingMsn"/ i<? if eq "$var:TechType" "IPPHONE" ` \n<tr><td class="c1"><span >reg_from_outside</span></td>\n<td class="c2">\n<? if eq "$var:IPPhoneExtRegFromOutside" "1"\n`\nyes\n` `\nno\n` ?>\n</td></tr>\n` ?>' ${dir}/fon_config_End.html 
    22         modsed '/id="uiIPPhoneExtNumber"/ a<input type="hidden" name="var:IPPhoneExtRegFromOutside" value="<? echo $var:IPPhoneExtRegFromOutside ?>" id="uiIPPhoneExtRegFromOutside">' ${dir}/fon_config.frm 
    23         modsed '/jslCopyValue( "uiIPPhoneExtNumber", "uiDevicePort")/ ajslSetValue( "uiIPPhoneExtRegFromOutside", (jslGetChecked("uiRegFromOutside"))? "1" : "0");' ${dir}/fon_config_IPPhone_1.js 
    24         modsed '/<\/table>/ i<tr style="padding-top:15px;padding-bottom:15px;">\n<td style="width: 190px; height:30px;">Registrierung v. Extern</td>\n<td><input type="checkbox" name="reg_from_outside" id="uiRegFromOutside"></td>\n</tr>' ${dir}/fon_config_IPPhone_1.html 
    25         modsed '/id="uiPostIPPhonePasswd"/ a<Input type="hidden" name="voipextension:settings/extension<? echo $var:DeviceIpPhonePort ?>/reg_from_outside" value="<? query voipextension:settings/extension<? echo $var:DeviceIpPhonePort ?>/reg_from_outside ?>" id="uiPostIPPhoneRegFromOutside">' ${dir}/fon1IPPhone.frm 
    26         modsed '/function uiDoOnLoad()/,/function uiDoCancel()/ {s%jslDisplay("uiIP_General",true);%&\njslGetCheckValue( "uiRegFromOutside", "uiPostIPPhoneRegFromOutside");% 1 ; s%if (jslGetValue("uiViewPassword") \!="\*\*\*\*")%jslSetCheckValue( "uiPostIPPhoneRegFromOutside", "uiRegFromOutside");\n&%1}' ${dir}/fon1IPPhone.js 
    27         modsed '/id="uiViewPassword"/ a</tr>\n<tr style="padding-top:15px;padding-bottom:15px;">\n<td style="width: 190px; height:30px;">Registrierung v. Extern</td>\n<td><input type="checkbox" name="reg_from_outside" id="uiRegFromOutside" value="0")"></td>' ${dir}/fon1IPPhone.html 
    28     done 
    29 fi 
     5SEARCHSTR='-name fon_config_End.frm  -o -name fon_config.frm -o -name fon_config_IPPhone_1.[j|h]*' 
     6[ "$FREETZ_TYPE_PREVIEW" == "y" ] && SEARCHSTR="$SEARCHSTR"' -o -name fon1IPPhone*' 
    307 
     8for file_n in $(find ${FILESYSTEM_MOD_DIR}/usr/www/ -type f  \( $SEARCHSTR \) -print); do 
     9    case $(basename "$file_n") in 
     10        fon_config_End.frm) 
     11            modsed '/id="uiPostIPPhoneExtNumber"/ a<Input type="hidden" name="voipextension:settings/extension<? echo $var:DeviceIpPhonePort ?>/reg_from_outside" value="" id="uiPostIPPhoneExtRegFromOutside" disabled>' "$file_n" 
     12            ;; 
     13        fon_config_End.js) 
     14            modsed '/jslEnable("uiPostIPPhoneExtNumber")/ ajslCopyValue( "uiPostIPPhoneExtRegFromOutside", "uiIPPhoneExtRegFromOutside"); jslEnable("uiPostIPPhoneExtRegFromOutside");' "$file_n" 
     15            ;; 
     16        fon_config_End.html) 
     17            modsed '/id="uiShowOutgoingMsn"/ i<? if eq "$var:TechType" "IPPHONE" ` \n<tr><td class="c1"><span >reg_from_outside</span></td>\n<td class="c2">\n<? if eq "$var:IPPhoneExtRegFromOutside" "1"\n`\nyes\n` `\nno\n` ?>\n</td></tr>\n` ?>' "$file_n" 
     18            ;; 
     19        fon_config.frm) 
     20            modsed '/id="uiIPPhoneExtNumber"/ a<input type="hidden" name="var:IPPhoneExtRegFromOutside" value="<? echo $var:IPPhoneExtRegFromOutside ?>" id="uiIPPhoneExtRegFromOutside">' "$file_n" 
     21            ;; 
     22        fon_config_IPPhone_1.js) 
     23            modsed '/jslCopyValue( "uiIPPhoneExtNumber", "uiDevicePort")/ ajslSetValue( "uiIPPhoneExtRegFromOutside", (jslGetChecked("uiRegFromOutside"))? "1" : "0");' "$file_n" 
     24            ;; 
     25        fon_config_IPPhone_1.html) 
     26            modsed '/<\/table>/ i<tr style="padding-top:15px;padding-bottom:15px;">\n<td style="width: 190px; height:30px;">Registrierung v. Extern</td>\n<td><input type="checkbox" name="reg_from_outside" id="uiRegFromOutside"></td>\n</tr>' "$file_n" 
     27            ;; 
     28        fon1IPPhone.frm) 
     29            modsed '/id="uiPostIPPhonePasswd"/ a<Input type="hidden" name="voipextension:settings/extension<? echo $var:DeviceIpPhonePort ?>/reg_from_outside" value="<? query voipextension:settings/extension<? echo $var:DeviceIpPhonePort ?>/reg_from_outside ?>" id="uiPostIPPhoneRegFromOutside">' "$file_n" 
     30            ;; 
     31        fon1IPPhone.js) 
     32            modsed '/function uiDoOnLoad()/,/function uiDoCancel()/ {s%jslDisplay("uiIP_General",true);%&\njslGetCheckValue( "uiRegFromOutside", "uiPostIPPhoneRegFromOutside");% 1 ; s%if (jslGetValue("uiViewPassword") \!="\*\*\*\*")%jslSetCheckValue( "uiPostIPPhoneRegFromOutside", "uiRegFromOutside");\n&%1}' "$file_n" 
     33            ;; 
     34        fon1IPPhone.html) 
     35            modsed '/id="uiViewPassword"/ a</tr>\n<tr style="padding-top:15px;padding-bottom:15px;">\n<td style="width: 190px; height:30px;">Registrierung v. Extern</td>\n<td><input type="checkbox" name="reg_from_outside" id="uiRegFromOutside" value="0")"></td>' "$file_n" 
     36            ;; 
     37        *) 
     38            warn "No Patch found for \"$file_n\" in patch for \"reg_from_outside\"" 
     39            ;; 
     40    esac 
     41    grep -q "RegFromOutside" "$file_n" && echo2 "  added Reg From Outside to file: ${file_n##*/}" 
     42done 
     43 
Hinweis: Hilfe zur Verwendung der Changeset-Ansicht finden Sie unter TracChangeset.