Когда нужно закрыть или открыть доступ только к некоторым мельти доменам


.htaccess:

SetEnvIfNoCase Host s4\.yandex\.ru$ require_auth=true
SetEnvIfNoCase Host s54\.yandex\.ru$ require_auth=true

AuthType Basic
AuthName «Access to the staging site»
AuthUserFile /data/www/yandex.ru/.htpasswd
Require valid-user

# Setup a deny/allow
Order Deny,Allow
# Deny from everyone
Deny from all
# except if either of these are satisfied
Satisfy any
# 1. a valid authenticated user
Require valid-user
# or 2. the «require_auth» var is NOT set
#Allow from env=!require_auth
Allow from env=require_auth

 

accessing gmail inbox via php code

<?php

$yourEmail = "you@gmail.com";
$yourEmailPassword = "your password";

$mailbox = imap_open("{imap.gmail.com:993/ssl}INBOX", $yourEmail, $yourEmailPassword);
$mail = imap_search($mailbox, "ALL");
$mail_headers = imap_headerinfo($mailbox, $mail[0]);
$subject = $mail_headers->subject;
$from = $mail_headers->fromaddress;
imap_setflag_full($mailbox, $mail[0], "\\Seen \\Flagged");
imap_close($mailbox);
?>