php - Restrict access to magento admin based on user agent? -


I'm just trying to allow access to the Magento Admin panel based on user agent. Any help is appreciated thanks!

Use MobileDetect.php (). This is a simple class to use.

  need_once 'Mobile_Detect.php'; $ Address = New Mobile_Detect; // a mobile device (phone or tablet) if ($ detect-> isMobile ()) {echo "Mobile"; } // if a tablet device ($ detect-> isTablet ()) {echo "tablet"; }  

Edit 1: added. Htaccess redirect Rewrite on

  Check for # noredirect rewritecond on the login% {QUERY_STRING} (^ & amp;) noredirect = true (& Amp; | $) # Set a cookie, and leave the next rule RewriteRule ^ - [CO = mredir: 0:% {HTTP_HOST}, S] #Check that it looks like a mobile device # (You can add another [or] for the second and whatever else you would like to check , But I believe most mobile devices should send at least one of these headers) RewriteCond% {http: x-wap-profile}! ^ $ [OR] RewriteCond% {http: profile}! ^ $ # Check that we are not already on the mobile site revoked code% {HTTP_HOST}! ^ M \. # Check to make sure that we have not set cookies before revittance% {http: cookies}! \ Smredir = 0 (| $$) #Rub redirect rules to the mobile site now ^ http: //m.example.org% {[edit] RE: | Blazer | Blanket | Allen | Fenchach | Hippos | IMobile | IP (Heine | OD) | Iris | Burning Lase \ | Memo | Midp | MMP | Opera \ em (ob | in) | Palm (\ os)? | Phone | P (ixi | re) \ / | Plucker | Pocket | Psp | Symbian | Treo | Up |. (Browser | link) | Vodafone | WAP | Windows | (Ce | phone |) | Xda | Xiino [NC, or] RewriteCond% {HTTP_USER_AGENT} ^ (1207 | 6310 | 6590 | 3gso | 4thp | 50 [1-6] i | 770s | 802s | one | ab | abac | ac (er | oo - s \ - ) | I (K | RN) | Al (av | ca | co) | amoi | one (ex | ny | yw) | aptu | ar (ch | go) | as | (te | us) | Attw | au (\ | m | r \ | s \) | avon | b (ck | lo | nac) | bi (lb | rd) | bl (ac | as) | br (e | v) wi | Beam | BW - - (N | U) | C55 \ | Capital | ccwa | CDM | - | Cell | chtm | CLDC | cmd | - | Co (mp | nd) | craw | da (this | link | ng) | Dbte | DC \ -s | Goddess | DICA | Dmob | Tax (c | P) | O | DS (12 | \ -d) | A (49 | AI) | (L2 | ul) | er (ic | k0) | esl8 | ez ([0] | | | | | | | | | | Fake | Fly (\ - | _) | G1 \ U | g560 | jean | gf \ -5 | g \ -mo | go (\ .w | od |) | GR (Advertising | United Nations) | Haiti | HCIT | HD \ - (M | P | T) | Haiti | - (hi |) | hi (pt | ta |) | hp (\ i | ip) | hs \ -c | ht (c (\ - | \ | _ | one | g | p | s | T) | TP). Hu (av | tc) | I \ - (20 | info | IA) | I230 | Iac (\ | \ - | \ /) | Ibrah | Thoughts | Ig01 | Ikom | Imaq | Inno | Ipaac | Iris | JA (T | V) A | JB | JMU | Jigs | KDD | KG Katie (\ | \ /) | Klon | Kpt \ | Kwc \ - | Kyo (c | k) | Le (no | xi) | LG (\ g | \ / (k | | L | U | 50 | 54 | E \ - | E \ / | '- [aw]) | Libw | Links | M1 \ W | M3ga | M50 / / Ma (to | ui | xo) | MC (01 | 21 | CA) | Meter \ -CR | Me (di | rc | ri) | Me (o 8 | Oa | TS) | MMEF | Mo (01 | 02 | b | d | dō | t (\ - | \ | o | v | zz) | MT (50 | P1 | V) | Mwbp | Mywa | N10 [0-2] | N20 [2-3] | N30 (0 | 2) | N50 (0 | 2 | 5) | N7 (0 (0 | 1) | 10) | Ni ((c | m) \ - | | | tf | wf | wg | wt | NOK (6 | i) | Nzph | O2im | Op (ti | wv) | Oran | Owg1 | P800 | Pan (an | d | t) | Pdxg | Postgraduate (13 | \ - ([1-8] | c)) | Fill | Empire | Pl (ay | uc) | PN \ -2 | Po (ck | RT | se) | Prox | Psio | Pt \ ji QA \ A-A | Qc (07 | 12 | 21 | 32 | 60 | | - [2-7] | I | - | Qtek | R380 | R600 | Raks | Rim9 || Ro (ve | zo) | S55 / | Bit (ge | ma | mm | ms | ny | va) | Scheduled Castes (01 | yes | - | U | P \ -) SDK \ / | Se (c (\ - | 0 | 1) | 47 | mc | nd | ri) | SGH \ - | Sharar | Sie (\ - | m) | Sk \ -0 | Sl (45 | id) | SM (al | ar | b3 | it | t5) | Such (Feet | NE) | Sp (01 | h \ - | v \ - | v \) | Sy (01 | mb) | T2 (18 | 50) | T6 (00 | 10 | 18) | Ta (GT | L.) | Tcl \ - | TDG \ - | Telephone (i | m) | Tim \ - | T \ -mo | To (pl | sh) | Ts (70 | m | - | m3 | m5) | Tx \ -9 | Up (\ b | g1 | c) | Utst | V400 | V750 | Verification | Vi (rg | to) | VK (40 | 5 [0-3] | \ -V) | Vm 40 Voda | Vulc | Vx (52 | 53 | 60 | 61 | 70 | 80 | 81 | 83 | 85 | 98) | W3c (\ - | \) | Webcaps | What Y (g \ | nc | nw) | Wmlb | Victory | X700 XDA (\ - | 2 | जी) | It \ - | Your | Zeta | ZTE \ -) ​​[NC] rewritable ^ $ http://m.website.com [R, L]  

Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -