Re: [PHP] 1984 (Big Brother)

2010-09-13 Thread viraj
On Tue, Sep 14, 2010 at 12:25 PM, viraj  wrote:
> got another idea.. setup the database on a machine which can detect
> the availability of the boss. if the boss machine is on.. and
> connected to network.. the script will try to verify the availability
> of the bosses's ip and interface hardware address. (if the boss change
> the nic or machine, mac has to be updated manually in the script) and
> starts or stops the database.
>
> this can be done with bit of shellexec and bit of shellscripting, if
> on linux with 'arp' (all employees and boss has to be in same subnet i
> guess.. )

and yeah, the script has to be run at some reasonable time interval using a cron

~viraj

>
> ~viraj
>
> On Tue, Sep 14, 2010 at 7:17 AM, Andy McKenzie  wrote:
>> On Mon, Sep 13, 2010 at 8:11 PM, Micky Hulse  
>> wrote:
>>> On Mon, Sep 13, 2010 at 5:05 PM, Daniel Brown  wrote:
    It would be cheaper to employ the same method used on some
 lawnmowers and required on Jet Skis and Skidoos: a cable with a clip
 worn by the rider.  The rider falls off, the cable releases from the
 vehicle, disengaging the throttle and cutting the engine.  The boss
 stands up, his entire infrastructure collapses, everyone's connections
 are closed, and all PCs subsequently catch fire.
>>>
>>> Lol! That would make a great Dilbert and/or Farside cartoon. :)
>>
>>
>> It would, wouldn't it?
>>
>> Anyway.  Something you could do is a script that turns mysqld on and
>> off:  set him up with an SSH connection to the server, and he can run
>> the script when he gets in to turn it on, and run it again whenever he
>> leaves to turn it off.  A cron job to turn mysqld off at whatever time
>> he usually leaves would probably be a reasonable failsafe.  If he
>> really wants you could probably link it to a swipe card system or just
>> a keyboard on his desk (enter your PIN to turn it on, enter it again
>> to turn it off).
>>
>> All that aside, I can't help feeling that this has gotten into "I'm
>> afraid you know too much for us to let you leave:  Guards!  Take him
>> away!" territory.
>>
>> -Alex
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] 1984 (Big Brother)

2010-09-13 Thread viraj
got another idea.. setup the database on a machine which can detect
the availability of the boss. if the boss machine is on.. and
connected to network.. the script will try to verify the availability
of the bosses's ip and interface hardware address. (if the boss change
the nic or machine, mac has to be updated manually in the script) and
starts or stops the database.

this can be done with bit of shellexec and bit of shellscripting, if
on linux with 'arp' (all employees and boss has to be in same subnet i
guess.. )

~viraj

On Tue, Sep 14, 2010 at 7:17 AM, Andy McKenzie  wrote:
> On Mon, Sep 13, 2010 at 8:11 PM, Micky Hulse  
> wrote:
>> On Mon, Sep 13, 2010 at 5:05 PM, Daniel Brown  wrote:
>>>    It would be cheaper to employ the same method used on some
>>> lawnmowers and required on Jet Skis and Skidoos: a cable with a clip
>>> worn by the rider.  The rider falls off, the cable releases from the
>>> vehicle, disengaging the throttle and cutting the engine.  The boss
>>> stands up, his entire infrastructure collapses, everyone's connections
>>> are closed, and all PCs subsequently catch fire.
>>
>> Lol! That would make a great Dilbert and/or Farside cartoon. :)
>
>
> It would, wouldn't it?
>
> Anyway.  Something you could do is a script that turns mysqld on and
> off:  set him up with an SSH connection to the server, and he can run
> the script when he gets in to turn it on, and run it again whenever he
> leaves to turn it off.  A cron job to turn mysqld off at whatever time
> he usually leaves would probably be a reasonable failsafe.  If he
> really wants you could probably link it to a swipe card system or just
> a keyboard on his desk (enter your PIN to turn it on, enter it again
> to turn it off).
>
> All that aside, I can't help feeling that this has gotten into "I'm
> afraid you know too much for us to let you leave:  Guards!  Take him
> away!" territory.
>
> -Alex
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Could this be a bug?

2010-09-13 Thread Thijs Lensselink

 On 09/14/2010 08:33 AM, Thijs Lensselink wrote:

 On 09/14/2010 12:16 AM, Camilo Sperberg wrote:
I have some really strange behaviour going on here, and I think it 
could be

a (minor) PHP's bug.
I am not really sure about what happens internally, but my best guess 
would

be that after a memory exhaustion, when I try to execute a custom error
handler with the register_shutdown_function (which is executed even 
after a

fatal error) and try to access the element that provoked the memory
exhaustion, no error should raise instead of *Uninitialized string 
offset:

0.

I have prepared a little test case to reproduce the error and (I 
hope) can

explain the error.

function my_error_handler($errno = '0', $errstr = '[FATAL] General 
Error',

$errfile = 'N/A', $errline = 'N/A', $errctx = '') {


This seems to be your error. You set $errctx to be a string. But later 
on you use it as an array.

Remove the = '' part. And it will function as expected.


   global $clean_exit;
   if(empty($clean_exit)) {
 ini_set('memory_limit','16M');
 ob_start();
 echo 'PHP v'.PHP_VERSION.', error N° '.$errno.'';
?>-- BEGIN COPY --Error N°:'.$errno.'';
?>Error Detail:'.$errstr.'File:'.$errfile.'Line:'.$errline.'Debug:';
 if (isset($errctx['r']['print'])) echo 'THIS LINE GIVES THE 
ERROR,

WHAT SHOULD IT RETURN?';


Maybe i'm missing something here (kinda sick at home) but..
What do you expect to happen here? When i do a var_dump() on $errctx i 
get


string(0) ""

That would explain the error you are seeing.


?>-- END COPY --Everything fine.';

$clean_exit = TRUE;

*
Would this be a bug or is this expected behaviour? I have tested this 
on PHP
v5.2.14, I've not tested it yet on 5.3.3, but I guess it would have 
the same

behaviour.

Greetings!







--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Could this be a bug?

2010-09-13 Thread Thijs Lensselink

 On 09/14/2010 12:16 AM, Camilo Sperberg wrote:

I have some really strange behaviour going on here, and I think it could be
a (minor) PHP's bug.
I am not really sure about what happens internally, but my best guess would
be that after a memory exhaustion, when I try to execute a custom error
handler with the register_shutdown_function (which is executed even after a
fatal error) and try to access the element that provoked the memory
exhaustion, no error should raise instead of *Uninitialized string offset:
0.

I have prepared a little test case to reproduce the error and (I hope) can
explain the error.

PHP v'.PHP_VERSION.', error N° '.$errno.'';
?>-- BEGIN COPY --Error N°:'.$errno.'';
?>Error Detail:'.$errstr.'File:'.$errfile.'Line:'.$errline.'Debug:';
 if (isset($errctx['r']['print'])) echo 'THIS LINE GIVES THE ERROR,
WHAT SHOULD IT RETURN?';


Maybe i'm missing something here (kinda sick at home) but..
What do you expect to happen here? When i do a var_dump() on $errctx i get

string(0) ""

That would explain the error you are seeing.


?>-- END COPY --Everything fine.';

$clean_exit = TRUE;

*
Would this be a bug or is this expected behaviour? I have tested this on PHP
v5.2.14, I've not tested it yet on 5.3.3, but I guess it would have the same
behaviour.

Greetings!




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Could this be a bug?

2010-09-13 Thread Camilo Sperberg
Well, after some more testing I'm almost sure it is some kind of strange
minor bug... so I've submitted a bug report:
http://bugs.php.net/bug.php?id=52833

Greetings !

On Tue, Sep 14, 2010 at 00:51, Camilo Sperberg  wrote:

>
> On Mon, Sep 13, 2010 at 18:56, Tamara Temple wrote:
>
>> This isn't to answer your question, but...
>>
>>
>> On Sep 13, 2010, at 5:16 PM, Camilo Sperberg wrote:
>>
>>> function my_error_handler($errno = '0', $errstr = '[FATAL] General
>>> Error',
>>> $errfile = 'N/A', $errline = 'N/A', $errctx = '') {
>>>  global $clean_exit;
>>>  if(empty($clean_exit)) {
>>>   ini_set('memory_limit','16M');
>>>   ob_start();
>>>   echo 'PHP v'.PHP_VERSION.', error N° '.$errno.'';
>>> ?>-- BEGIN COPY --Error N°:>>  echo ''.$errno.'';
>>> ?>Error Detail:>>   echo ''.$errstr.'File:>> />'.$errfile.'Line:>> />'.$errline.'Debug:';
>>>   if (isset($errctx['r']['print'])) echo 'THIS LINE GIVES THE ERROR,
>>> WHAT SHOULD IT RETURN?';
>>> ?>-- END COPY -->>   $content = ob_get_contents();
>>>   ob_end_clean();
>>>   die($content);
>>>  }
>>> }
>>>
>>
>> Why do you put  inside an echo statement in php space?
>>
>>
>
> I think you may have mis-readed the code, I can't find where I put an  echo inside an echo. I do a lot of opening/closing tags which contributes to
> messing things up estetically but it works...
>
> Any way, the posted code had a lot of remniscants of the production code,
> here is a simplified version which does the same as above but .. well,
> simplified :P
>
>  date_default_timezone_set('America/Santiago');
> ini_set('memory_limit','1M');
> ini_set('display_errors',1);
> error_reporting(-1);
>
> function my_error_handler($errno = '0', $errstr = '[FATAL] General Error',
> $errfile = 'N/A', $errline = 'N/A', $errctx = '') {
>   global $clean_exit;
>   if(empty($clean_exit)) { // if isset or !empty, the script would have
> been exited cleanly.
> ini_set('memory_limit','16M'); // This would be just to have enough
> memory to print out the error.
> echo '-- BEGIN ERROR --Error N°:
> '.$errno.'Error Description:
> '.$errstr.'File: '.$errfile.' />Line: '.$errline.'';
> if (isset($errctx['r']['print'])) echo 'THIS LINE GIVES THE ERROR,
> WHAT SHOULD IT RETURN?'; // isset or empty gives the same error
> echo '-- END ERROR --';
> die(); // shutdown_function == manual die() or else it will continue to
> execute.
>
>   }
> }
> set_error_handler('my_error_handler');
> register_shutdown_function('my_error_handler');
>
> for ($i = 0; $i < 15000; $i++) $a[$i] = mt_rand(1,255);
> $r['print'] = (string)$a[1]; // Just to asign something to that variable.
>
> echo 'Everything fine.';
> $clean_exit = TRUE;
>
>
> Greetings :)
>
> --
> Mailed by:
> UnReAl4U - unreal4u
> ICQ #: 54472056
> www1: http://www.chw.net/
> www2: http://unreal4u.com/
>



-- 
Mailed by:
UnReAl4U - unreal4u
ICQ #: 54472056
www1: http://www.chw.net/
www2: http://unreal4u.com/


Re: [PHP] Could this be a bug?

2010-09-13 Thread Camilo Sperberg
On Mon, Sep 13, 2010 at 18:56, Tamara Temple wrote:

> This isn't to answer your question, but...
>
>
> On Sep 13, 2010, at 5:16 PM, Camilo Sperberg wrote:
>
>> function my_error_handler($errno = '0', $errstr = '[FATAL] General Error',
>> $errfile = 'N/A', $errline = 'N/A', $errctx = '') {
>>  global $clean_exit;
>>  if(empty($clean_exit)) {
>>   ini_set('memory_limit','16M');
>>   ob_start();
>>   echo 'PHP v'.PHP_VERSION.', error N° '.$errno.'';
>> ?>-- BEGIN COPY --Error N°:>  echo ''.$errno.'';
>> ?>Error Detail:>   echo ''.$errstr.'File:> />'.$errfile.'Line:> />'.$errline.'Debug:';
>>   if (isset($errctx['r']['print'])) echo 'THIS LINE GIVES THE ERROR,
>> WHAT SHOULD IT RETURN?';
>> ?>-- END COPY -->   $content = ob_get_contents();
>>   ob_end_clean();
>>   die($content);
>>  }
>> }
>>
>
> Why do you put  inside an echo statement in php space?
>
>

I think you may have mis-readed the code, I can't find where I put an -- BEGIN ERROR --Error N°:
'.$errno.'Error Description:
'.$errstr.'File: '.$errfile.'Line: '.$errline.'';
if (isset($errctx['r']['print'])) echo 'THIS LINE GIVES THE ERROR,
WHAT SHOULD IT RETURN?'; // isset or empty gives the same error
echo '-- END ERROR --';
die(); // shutdown_function == manual die() or else it will continue to
execute.
  }
}
set_error_handler('my_error_handler');
register_shutdown_function('my_error_handler');

for ($i = 0; $i < 15000; $i++) $a[$i] = mt_rand(1,255);
$r['print'] = (string)$a[1]; // Just to asign something to that variable.
echo 'Everything fine.';
$clean_exit = TRUE;

Greetings :)

-- 
Mailed by:
UnReAl4U - unreal4u
ICQ #: 54472056
www1: http://www.chw.net/
www2: http://unreal4u.com/


Re: [PHP] Question about news.php.net

2010-09-13 Thread MikeB

Daniel Brown wrote:

On Mon, Sep 13, 2010 at 19:51, MikeB  wrote:


As part of the bug report I included a link to an image of my nntp config.


 I saw that, thanks.  I'll look into creating a mirror of the news
server, as well, for NNTP-only access.  I won't lie and say that it's
a priority, but I'll try to get to it as soon as I have time, Mike.

That is much appreciated. I can understand the situation, mostly I just 
wanted to know that it wasn't something I'm doing wrong. ANything you 
can do to improve it is, of course, appreciated.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] 1984 (Big Brother)

2010-09-13 Thread Andy McKenzie
On Mon, Sep 13, 2010 at 8:11 PM, Micky Hulse  wrote:
> On Mon, Sep 13, 2010 at 5:05 PM, Daniel Brown  wrote:
>>    It would be cheaper to employ the same method used on some
>> lawnmowers and required on Jet Skis and Skidoos: a cable with a clip
>> worn by the rider.  The rider falls off, the cable releases from the
>> vehicle, disengaging the throttle and cutting the engine.  The boss
>> stands up, his entire infrastructure collapses, everyone's connections
>> are closed, and all PCs subsequently catch fire.
>
> Lol! That would make a great Dilbert and/or Farside cartoon. :)


It would, wouldn't it?

Anyway.  Something you could do is a script that turns mysqld on and
off:  set him up with an SSH connection to the server, and he can run
the script when he gets in to turn it on, and run it again whenever he
leaves to turn it off.  A cron job to turn mysqld off at whatever time
he usually leaves would probably be a reasonable failsafe.  If he
really wants you could probably link it to a swipe card system or just
a keyboard on his desk (enter your PIN to turn it on, enter it again
to turn it off).

All that aside, I can't help feeling that this has gotten into "I'm
afraid you know too much for us to let you leave:  Guards!  Take him
away!" territory.

-Alex

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] 1984 (Big Brother)

2010-09-13 Thread Micky Hulse
On Mon, Sep 13, 2010 at 5:05 PM, Daniel Brown  wrote:
>    It would be cheaper to employ the same method used on some
> lawnmowers and required on Jet Skis and Skidoos: a cable with a clip
> worn by the rider.  The rider falls off, the cable releases from the
> vehicle, disengaging the throttle and cutting the engine.  The boss
> stands up, his entire infrastructure collapses, everyone's connections
> are closed, and all PCs subsequently catch fire.

Lol! That would make a great Dilbert and/or Farside cartoon. :)

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Question about news.php.net

2010-09-13 Thread Shawn McKenzie
On 09/13/2010 06:51 PM, MikeB wrote:
> Daniel Brown wrote:
>>
>>  I don't believe that we've been having any issues with the server,
>> no.  Are you using NNTP to connect?
> 
> yes, NNTP.
> 
>> You may want to consider using
>> the HTTP-based RSS and/or RDF feeds if it continues to be an issue.
> 
> If this persists, I'll look into the alternatives you suggest, but
> that's another hill to climb when all I'm trying to do is learn PHP and
> web and mySQL and javascrip and...   :)  (not complaining, just that
> right now I've got a lot on my plate and the scope of new things just
> seem to keep expanding faster than I can get a handle on it).
> 
>> In addition, if you continue to have problems, file a bug report at
>> http://bugs.php.net/ and we'll look into it further.
>>
> Thanks, I did that. In the process I found a 2005 bug report that said
> nntp was deliberately throttled to discourage its use... :)
> 
> As part of the bug report I included a link to an image of my nntp config.
> 
> 

I have had this problem every day for years.  I can read a message and
then click another one and it times out.  It does this for hours at a
time.  Also, many times when sending a reply it times out.  Just learned
to live with it because I don't want mailing list mails either.


-- 
Thanks!
-Shawn
http://www.spidean.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Question about news.php.net

2010-09-13 Thread Daniel Brown
On Mon, Sep 13, 2010 at 19:51, MikeB  wrote:
>
> As part of the bug report I included a link to an image of my nntp config.

I saw that, thanks.  I'll look into creating a mirror of the news
server, as well, for NNTP-only access.  I won't lie and say that it's
a priority, but I'll try to get to it as soon as I have time, Mike.

-- 

Network Infrastructure Manager
Documentation, Webmaster Teams
http://www.php.net/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] 1984 (Big Brother)

2010-09-13 Thread Daniel Brown
On Mon, Sep 13, 2010 at 19:47, Micky Hulse  wrote:
>
> Motion sensing camera connected to a mechanical pointer stick aimed to
> trigger the server power button.
>
> On his way out of the office:
>
> Clap on/clap off Clapper connected to computer power cable.

It would be cheaper to employ the same method used on some
lawnmowers and required on Jet Skis and Skidoos: a cable with a clip
worn by the rider.  The rider falls off, the cable releases from the
vehicle, disengaging the throttle and cutting the engine.  The boss
stands up, his entire infrastructure collapses, everyone's connections
are closed, and all PCs subsequently catch fire.

Realistically, a simple desktop-based application running in the
system tray (presuming Windows) would send a kill signal to a
predefined script to issue safe closing routines to the database
first, then any other systems he wants to close out.  It could even
have simple options to poll if there's a screensaver activated, which
would initiate the process automatically, should he choose to be
extremely paranoid.  The same could be automated to work in reverse,
to automatically bring the systems up, when the local desktop session
becomes active (from hibernation, logoff, or screensaver), or even
with an override ("Pause Sessions") by right-clicking the systray
icon.

It's no surprise to several here that I'm not a big fan of
Windows but I do still like to stay on top of programming
languages, and at least give each one a try.  Something of interest to
no one: my first full-production, open-source project that included
PHP was actually a combination of a PHP server-side script and Windows
client script, written in VB, back in 2000.  It was named phpCourier,
and was used as a client-server CMS for simple news postings (before
"blog" became a catchphrase).  It was downloaded a few thousand times,
and then I quit hosting it.  I may actually have that server with
those files and a bunch of other old projects in my basement.  Now I'm
suddenly interested in unpacking and organizing everything.

-- 

Network Infrastructure Manager
Documentation, Webmaster Teams
http://www.php.net/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: [!! SPAM] Re: [PHP] 1984 (Big Brother)

2010-09-13 Thread Phpster


On Sep 13, 2010, at 17:49, Tim Thorburn  wrote:

> On 9/13/2010 9:10 AM, Steve Staples wrote:
>> here's a silly idea...
>> 
>> put the database on his computer (or the entire app).  that way, when
>> he's *there* he is logged in.  if the computer is off, he's not there,
>> the app wont work (and the database).
>> 
>> Steve
>> 
>> 
>> 
>> On Mon, 2010-09-13 at 11:26 +0100, Richard Quadling wrote:
>>> On 12 September 2010 17:32, tedd  wrote:
 Hi gang:
 
 I have a client who wants his employees' access to their online business
 database restricted to only times when he is logged on. (Don't ask why)
 
 In other words, when the boss is not logged on, then his employees cannot
 access the business database in any fashion whatsoever including checking 
 to
 see if the boss is logged on, or not. No access whatsoever!
 
 Normally, I would just set up a field in the database and have that set to
 "yes" or "no" as to if the employees could access the database, or not. But
 in this case, the boss does not want even that type of access to the
 database permitted. Repeat -- No access whatsoever!
 
 I was thinking of the boss' script writing to a file that accomplished the
 "yes" or "no" thing, but if the boss did not log off properly then the file
 would remain in the "yes" state allowing employees undesired access. That
 would not be acceptable.
 
 So, what methods would you suggest?
 
 Cheers,
 
 tedd
>>> What operating system is he using?
>>> 
>>> Does he (for example), log into his computer and logoff/shutdown when
>>> he goes home?
>>> 
>>> If he is using Windows (and I'm sure there are many ways to achieve
>>> this), then in the Startup folder, a small PHP script which sets a
>>> flag "I'm here", would allow the DB to know he's at least logged in.
>>> 
>>> There are different ways to do this.
>>> http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/Windows/XP/Q_21195727.html
>>> covers login/logout/startup/shutdown.
>>> 
>>> 
>>> Do they have a clock card system for clocking in/out the building?
>>> Could you read the database that the clockings are logged in? An odd
>>> number for the day = he's in, even = he's out, missed clocking =
>>> screwed/guess.
>>> 
>>> Ideally you want to "hook" into his normal activity if you can.
>>> 
>>> 
>>> 
>>> -- 
>>> Richard Quadling
>>> Twitter : EE : Zend
>>> @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY
>>> 
>> 
>> 
> I'm pretty sure I'd have run for the hills after my first meeting with this 
> client, but if you're sure you want to proceed ... Beyond the options 
> mentioned, you could set it up so that the boss would log in each morning 
> with a session that times out at the end of the work day (8, 10, 12, w/e 
> hours later).  To make it even more secure, you could have the boss create 
> new logins for each employee at the start of each day.  Since yesterdays 
> passwords will no longer work, the boss will have to be there to issue new 
> passwords to whomever he deems worthy of access on this day.  These passwords 
> would of course expire at the normal leaving time, so if someone came in late 
> for a password at 4pm and work ends at 6pm, their password would only last 
> two more hours.
> 
> All in all, I'd still grill him more about what it is he actually wants and 
> why, as all of the ideas presented thus far have at least a dozen different 
> ways things can go wrong.  Putting the app on the bosses computer sounds 
> great and all, but if he's sick or away on business suddenly no one in the 
> office is doing any work.  Or when his hdd gives out or is replaced and IT's 
> backup system wasn't as great as it could have been you'll have fun getting 
> paid to re-do everything.  Having everything require a usb stick to launch 
> sounds secure, until he loses the stick or forgets it at home one day.  For 
> fun I'd suggest tagging him with a microchip which your application will 
> constantly scan for and only activate when he's within a certain radius of 
> his desk.  Retna scans shouldn't be overlooked either.  Impossible theme here>
> 
> May the force be with you on this one.
> 
> -Tim

Well, if we are going down this route, many new laptops are offering some form 
of biometrics for access. If your client has one, you could potentially launch 
a script to start/ stop the db at that time. 

Or if we follow the new password suggestion, his morning login could run a 
script to reset and email all users their passwords automatically. 

Bastien

Sent from my iPod



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Question about news.php.net

2010-09-13 Thread MikeB

Daniel Brown wrote:


 I don't believe that we've been having any issues with the server,
no.  Are you using NNTP to connect?


yes, NNTP.


You may want to consider using
the HTTP-based RSS and/or RDF feeds if it continues to be an issue.


If this persists, I'll look into the alternatives you suggest, but 
that's another hill to climb when all I'm trying to do is learn PHP and 
web and mySQL and javascrip and...   :)  (not complaining, just that 
right now I've got a lot on my plate and the scope of new things just 
seem to keep expanding faster than I can get a handle on it).



In addition, if you continue to have problems, file a bug report at
http://bugs.php.net/ and we'll look into it further.

Thanks, I did that. In the process I found a 2005 bug report that said 
nntp was deliberately throttled to discourage its use... :)


As part of the bug report I included a link to an image of my nntp config.



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] 1984 (Big Brother)

2010-09-13 Thread Micky Hulse
On Mon, Sep 13, 2010 at 2:43 PM, chris h  wrote:
> "How would you like the system to be aware of rather or not you're in the
> office?

On his way in to the office:

Motion sensing camera connected to a mechanical pointer stick aimed to
trigger the server power button.

On his way out of the office:

Clap on/clap off Clapper connected to computer power cable.

:D

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Question about news.php.net

2010-09-13 Thread Daniel Brown
On Mon, Sep 13, 2010 at 18:09, MikeB  wrote:
>
> However, getting access seems to be hit-and-miss, since I more often than
> not get a message that the connection to news.php.net timed out.
>
> Is this an indication that the server is just very busy? I don't get this on
> any other news server I'm using on the smae news reader and I have gotten
> this on two different news readers that I have tried.

I don't believe that we've been having any issues with the server,
no.  Are you using NNTP to connect?  You may want to consider using
the HTTP-based RSS and/or RDF feeds if it continues to be an issue.
In addition, if you continue to have problems, file a bug report at
http://bugs.php.net/ and we'll look into it further.

-- 

Network Infrastructure Manager
Documentation, Webmaster Teams
http://www.php.net/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Could this be a bug?

2010-09-13 Thread Tamara Temple

This isn't to answer your question, but...

On Sep 13, 2010, at 5:16 PM, Camilo Sperberg wrote:
function my_error_handler($errno = '0', $errstr = '[FATAL] General  
Error',

$errfile = 'N/A', $errline = 'N/A', $errctx = '') {
 global $clean_exit;
 if(empty($clean_exit)) {
   ini_set('memory_limit','16M');
   ob_start();
   echo 'PHP v'.PHP_VERSION.', error N° '.$errno.'';
?>-- BEGIN COPY --Error N°:'.$errno.'';
?>Error Detail:'.$errstr.'File:'.$errfile.'Line:'.$errline.'Debug:';
   if (isset($errctx['r']['print'])) echo 'THIS LINE GIVES THE  
ERROR,

WHAT SHOULD IT RETURN?';
?>-- END COPY --

Why do you put  inside an echo statement in php space?


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Could this be a bug?

2010-09-13 Thread Camilo Sperberg
I have some really strange behaviour going on here, and I think it could be
a (minor) PHP's bug.
I am not really sure about what happens internally, but my best guess would
be that after a memory exhaustion, when I try to execute a custom error
handler with the register_shutdown_function (which is executed even after a
fatal error) and try to access the element that provoked the memory
exhaustion, no error should raise instead of *Uninitialized string offset:
0.

I have prepared a little test case to reproduce the error and (I hope) can
explain the error.

PHP v'.PHP_VERSION.', error N° '.$errno.'';
?>-- BEGIN COPY --Error N°:'.$errno.'';
?>Error Detail:'.$errstr.'File:'.$errfile.'Line:'.$errline.'Debug:';
if (isset($errctx['r']['print'])) echo 'THIS LINE GIVES THE ERROR,
WHAT SHOULD IT RETURN?';
?>-- END COPY --Everything fine.';

$clean_exit = TRUE;

*
Would this be a bug or is this expected behaviour? I have tested this on PHP
v5.2.14, I've not tested it yet on 5.3.3, but I guess it would have the same
behaviour.

Greetings!

-- 
Mailed by:
UnReAl4U - unreal4u
ICQ #: 54472056
www1: http://www.chw.net/
www2: http://unreal4u.com/


[PHP] Question about news.php.net

2010-09-13 Thread MikeB
If there is a more appropriate place to ask this, I apologize. Please 
point me in the right direction.


I understand that the news server is based on a mailing list, but I 
can't handle another high-volume source dumping stuff into my email 
(even if I filter it into a separate folder) so I am trying to subscribe 
through the news group.


However, getting access seems to be hit-and-miss, since I more often 
than not get a message that the connection to news.php.net timed out.


Is this an indication that the server is just very busy? I don't get 
this on any other news server I'm using on the smae news reader and I 
have gotten this on two different news readers that I have tried.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] 1984 (Big Brother)

2010-09-13 Thread Daevid Vincent
> have been you'll have fun getting paid to re-do everything.  Having 
> everything require a usb stick to launch sounds secure, until 
> he loses 
> the stick or forgets it at home one day.  For fun I'd suggest tagging 

...or pulls it out before all the writes have taken place from the cache or
mysql's DELAYED WRITES and so the DB is corrupt or lost integrity.

*sigh*


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: [!! SPAM] Re: [PHP] 1984 (Big Brother)

2010-09-13 Thread Tim Thorburn

 On 9/13/2010 9:10 AM, Steve Staples wrote:

here's a silly idea...

put the database on his computer (or the entire app).  that way, when
he's *there* he is logged in.  if the computer is off, he's not there,
the app wont work (and the database).

Steve



On Mon, 2010-09-13 at 11:26 +0100, Richard Quadling wrote:

On 12 September 2010 17:32, tedd  wrote:

Hi gang:

I have a client who wants his employees' access to their online business
database restricted to only times when he is logged on. (Don't ask why)

In other words, when the boss is not logged on, then his employees cannot
access the business database in any fashion whatsoever including checking to
see if the boss is logged on, or not. No access whatsoever!

Normally, I would just set up a field in the database and have that set to
"yes" or "no" as to if the employees could access the database, or not. But
in this case, the boss does not want even that type of access to the
database permitted. Repeat -- No access whatsoever!

I was thinking of the boss' script writing to a file that accomplished the
"yes" or "no" thing, but if the boss did not log off properly then the file
would remain in the "yes" state allowing employees undesired access. That
would not be acceptable.

So, what methods would you suggest?

Cheers,

tedd

What operating system is he using?

Does he (for example), log into his computer and logoff/shutdown when
he goes home?

If he is using Windows (and I'm sure there are many ways to achieve
this), then in the Startup folder, a small PHP script which sets a
flag "I'm here", would allow the DB to know he's at least logged in.

There are different ways to do this.
http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/Windows/XP/Q_21195727.html
covers login/logout/startup/shutdown.


Do they have a clock card system for clocking in/out the building?
Could you read the database that the clockings are logged in? An odd
number for the day = he's in, even = he's out, missed clocking =
screwed/guess.

Ideally you want to "hook" into his normal activity if you can.



--
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY




I'm pretty sure I'd have run for the hills after my first meeting with 
this client, but if you're sure you want to proceed ... Beyond the 
options mentioned, you could set it up so that the boss would log in 
each morning with a session that times out at the end of the work day 
(8, 10, 12, w/e hours later).  To make it even more secure, you could 
have the boss create new logins for each employee at the start of each 
day.  Since yesterdays passwords will no longer work, the boss will have 
to be there to issue new passwords to whomever he deems worthy of access 
on this day.  These passwords would of course expire at the normal 
leaving time, so if someone came in late for a password at 4pm and work 
ends at 6pm, their password would only last two more hours.


All in all, I'd still grill him more about what it is he actually wants 
and why, as all of the ideas presented thus far have at least a dozen 
different ways things can go wrong.  Putting the app on the bosses 
computer sounds great and all, but if he's sick or away on business 
suddenly no one in the office is doing any work.  Or when his hdd gives 
out or is replaced and IT's backup system wasn't as great as it could 
have been you'll have fun getting paid to re-do everything.  Having 
everything require a usb stick to launch sounds secure, until he loses 
the stick or forgets it at home one day.  For fun I'd suggest tagging 
him with a microchip which your application will constantly scan for and 
only activate when he's within a certain radius of his desk.  Retna 
scans shouldn't be overlooked either. 


May the force be with you on this one.

-Tim


Re: [PHP] 1984 (Big Brother)

2010-09-13 Thread chris h
On Mon, Sep 13, 2010 at 5:09 PM, Daevid Vincent  wrote:

>
>
> > -Original Message-
> > From: tedd [mailto:t...@sperling.com]
> > Sent: Sunday, September 12, 2010 9:32 AM
> > To: PHP-General list
> > Subject: [PHP] 1984 (Big Brother)
> >
> > Hi gang:
> >
> > I have a client who wants his employees' access to their online
> > business database restricted to only times when he is logged on.
> > (Don't ask why)
> >
> > In other words, when the boss is not logged on, then his employees
> > cannot access the business database in any fashion whatsoever
> > including checking to see if the boss is logged on, or not. No access
> > whatsoever!
> >
> > Normally, I would just set up a field in the database and have that
> > set to "yes" or "no" as to if the employees could access the
> > database, or not. But in this case, the boss does not want even that
> > type of access to the database permitted. Repeat -- No access
> > whatsoever!
> >
> > I was thinking of the boss' script writing to a file that
> > accomplished the "yes" or "no" thing, but if the boss did not log off
> > properly then the file would remain in the "yes" state allowing
> > employees undesired access. That would not be acceptable.
> >
> > So, what methods would you suggest?
> >
> > Cheers,
> >
> > tedd
>
> You sure know how to pick'em Tedd.
>
> This is the second "whacky" client you've posted about on the list...
>
> This guy sounds like a real control-freak (read: tool).
>
> One other thing I'll throw out is the use of a crontab to start/stop mysql
> during "boss's hours". I don't have a complete solution for you as I just
> don't care enough about helping this Dbag lord over his employees like
> that, but I suspect you could have "/etc/init.d/mysql start" or "stop" at
> some pre-determined times like 8am - noon. Then noon till 5pm. Or
> something.
>
> RDBMS are not really designed to be turned on and off like that.
>
> Another option is to maybe use M$ Access instead (which does have a
> multi-user mode). Use ODBC to connect via PHP to it. So then he would start
> up the DB when he likes and shut it down when he likes. (note that a logout
> of Windows will NOT prevent the ODBC connection as it is a service -- as
> God intended RDBMS to be)
> http://www.configure-all.com/php_access.php
>
> This guy is making me angry just thinking about it!
>
> d
>
>

Yes I've been following this post purely in the hope that someone gets Tedd
is explain the client's "logic" on this one.  It's one thing for a layman to
have this kind of requirement, but another entirely for them to STILL have
it after an explanation.  I mean part of consulting is to tell the client
when they're wrong, for someone to not heed that when they are paying for
the advice is mind boggling. *sigh* if only everyone were perfect like me...
 :p

"Hey lets pay someone to consult us on a subject that we're ignorant of."
"Great idea! And when he makes a suggestion we can totally ignore him! SQL -
Shmeequal"


Rant aside; I would defer the logistics to the client.  He wants the DB to
shutdown when he's not in the office? Ok no problem - not what it was
designed to do, but no problem!

"How would you like the system to be aware of rather or not you're in the
office? It can assume you are between these hours; You can log into a screen
that unlocked it, but then you have to logout; we can put a motion detector
in your office; ... etc."

This would put the consequences of the system off on the client. Because if
this system works then there will be consequences and you'll look like a
jerk  :-)

Btw, are there no cron / batch jobs that need to run over night?



Chris


RE: [PHP] 1984 (Big Brother)

2010-09-13 Thread Daevid Vincent
 

> -Original Message-
> From: tedd [mailto:t...@sperling.com] 
> Sent: Sunday, September 12, 2010 9:32 AM
> To: PHP-General list
> Subject: [PHP] 1984 (Big Brother)
> 
> Hi gang:
> 
> I have a client who wants his employees' access to their online 
> business database restricted to only times when he is logged on. 
> (Don't ask why)
> 
> In other words, when the boss is not logged on, then his employees 
> cannot access the business database in any fashion whatsoever 
> including checking to see if the boss is logged on, or not. No access 
> whatsoever!
> 
> Normally, I would just set up a field in the database and have that 
> set to "yes" or "no" as to if the employees could access the 
> database, or not. But in this case, the boss does not want even that 
> type of access to the database permitted. Repeat -- No access 
> whatsoever!
> 
> I was thinking of the boss' script writing to a file that 
> accomplished the "yes" or "no" thing, but if the boss did not log off 
> properly then the file would remain in the "yes" state allowing 
> employees undesired access. That would not be acceptable.
> 
> So, what methods would you suggest?
> 
> Cheers,
> 
> tedd

You sure know how to pick'em Tedd. 

This is the second "whacky" client you've posted about on the list...

This guy sounds like a real control-freak (read: tool).

One other thing I'll throw out is the use of a crontab to start/stop mysql
during "boss's hours". I don't have a complete solution for you as I just
don't care enough about helping this Dbag lord over his employees like
that, but I suspect you could have "/etc/init.d/mysql start" or "stop" at
some pre-determined times like 8am - noon. Then noon till 5pm. Or
something.

RDBMS are not really designed to be turned on and off like that.

Another option is to maybe use M$ Access instead (which does have a
multi-user mode). Use ODBC to connect via PHP to it. So then he would start
up the DB when he likes and shut it down when he likes. (note that a logout
of Windows will NOT prevent the ODBC connection as it is a service -- as
God intended RDBMS to be)
http://www.configure-all.com/php_access.php

This guy is making me angry just thinking about it!

d


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: php cli question

2010-09-13 Thread J Ravi Menon
On Sat, Sep 11, 2010 at 8:50 PM, Shawn McKenzie  wrote:
> On 09/10/2010 11:13 AM, J Ravi Menon wrote:
>> Hi,
>>
>> I have some basic questions on running php  (5.2.x series on Linux
>> 2.6) as a standalone daemon using posix methods (fork() etc..):
>>
>> #!/usr/bin/php
>> >
>> require_once ('someclass.php');
>>
>> // do some initializations
>> .
>>
>> // main 'forever' loop - the '$shutdown'  will
>> // be set to true via a signal handler
>>
>> while(!$shutdown)
>> {
>>   $a = new SomeClass();
>>
>>   $a->doSomething()
>>
>> }
>>
>> // shutdown logic.
>>
>> The 'someclass.php' in turn will include other files (via require_once).
>>
>> The above file will be executed directly from the shell. The main loop
>> could be listening to new requests via sockets etc..
>>
>> Few questions:
>>
>> 1) Does opcode cache really matter in such cli-based daemons? As
>> 'SomeClass' is instantiated at every loop, I am assuming it is only
>> compiled once as it has already been 'seen'.
>>     I am not very clear on how apc (or eaccelerator) works in such cases.
>>
>>
>> 2) What about garbage collection? In a standard apache-mod-php setup,
>> we rely on the end of a request-cycle to free up resources - close
>> file descriptiors, free up memory etc..
>>     I am assuming in the aforesaid standalone daemon case, we would
>> have to do this manually?  In the loop above, would it be better to
>> 'unset($a)' explicitly at the end of it before
>>     it goes to the next iteration?
>>
>> Note: I have written pre-forker deamons in php directly and
>> successfully deployed them in the past, but never looked at in depth
>> to understand all the nuances. Anecdotally, I have
>> done 'unset()' at some critical places were large arrays were used,
>> and I think it helped. AFAIK, unlike Java, there is no 'garbage
>> collector' thread that does all the magic?
>>
>> Thanks,
>> Ravi
>
> If I have time when you reply I'll answer the questions, but I must ask:
>  Is this purely academic?  Why is this a concern?  Have you encountered
> issues?  If so, what?

@Tom: I have compiled php with pcntl on and this has never been an
issue. It works well (on a linux setup), and I have deployed
standalone daemons with out any major problems. I have a home-grown
'preforker' framework (which I hope to share soon) which can be used
to exploit multi-core boxes.

@Shawn: It is not academic. There is a follow-up I am planning based
on the doubts above. I have deployed such daemons in the past with
some assumptions on (2) by doing manual cleanups - e.g. closing curl
connections, closing up db handles etc...  Really want to understand
how php works in such setups outside of apache+mod_php.

thanks,
Ravi







>
> --
> Thanks!
> -Shawn
> http://www.spidean.com
>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Standalone WebServer for PHP

2010-09-13 Thread Bostjan Skufca
I would recommend using nanoserv, it looks more mature.

But personally I use my own, which I have developed because I wanted to know
how to do it. And because I needed it to do some specific tasks on linux
servers which I did not want to mix with apache configuration etc. Here:
http://github.com/bostjan/PHP-application-server

b.


On 13 September 2010 14:47, Steve Staples  wrote:

> Wow... this thread SURE went WAY off my original topic...
>
>
> All I was looking for, was a "webserver" that would serve "PHP" pages,
> that was not "installed" on the machine.   Now, if the machine was *nix
> or Windose, it didn't matter.
>
> I know in Python, you just have to install python, and then you can use
> Cherrypy (but i dont know python, nor do i want to create the app i am
> creating with a language i dont full know/understand).
>
> Anyway, I spent a bit of time on the interwebs this weekend, and after
> trying just about every one i could find, I am just going to go with
> XAMPP, and remove all the stuff i dont need, and trim some fat, and
> remove all the hard links to the /opt/lampp directory in linux, and
> figure out what it is in windose later...
>
> anyway, thanks for all the ideas.
>
> Steve.
>
>
> On Sun, 2010-09-12 at 22:37 -0400, Paul M Foster wrote:
> > On Sun, Sep 12, 2010 at 02:07:12PM -0400, tedd wrote:
> >
> > > At 1:47 PM -0400 9/12/10, Jason Pruim wrote:
> > > >>On Sep 12, 2010, at 1:33 PM, tedd wrote:
> > > >>So, can I do what I do (i.e., programming) without having a host?
> > > >>Can I install a local server at my clients location and interface
> > > >>all their computers to use the server without them ever being
> > > >>connected to the Internet?
> > > >
> > > >I may not know all the possibilities but the only way I can think of
> > > >to accomplish that  would be to have a server setup in their office
> > > >with a bank of modems and have everyone call into the server.
> > > >Basically like an old school internet provider.
> > > >
> > > >If the main server can be secured to your clients liking there are
> > > >ways that it can be on the net and still as safe as possible... But
> > > >obviously not as safe as hard lines being dialed in...
> > > >
> > > >You'ld also have to take into account possibly long distance charges
> > > >if everyone wasn't local...
> > >
> > > Forget modems or other such outside access -- everything would be
> > > done internally with computers and users being physically located
> > > within the office's physical location.
> > >
> > > So, could a server be set up in an office that would run
> > > web-languages such that users in the office could access their server
> > > and run scripts using browsers?
> >
> > I just think I couldn't possibly be fully understanding what you're
> > asking. But in case I *do* understand it, it would be like this:
> >
> > Set up a switch in the server room and connect everyone to it. Connect
> > the switch to the internal webserver. Give the webserver an internal
> > (non-routable) IP and hostname. Anyone can access it via
> > http://internal_hostname/my_script.php
> >
> > No one outside the LAN can access it, something you can enforce with
> > Apache or with iptables (Linux).
> >
> > I have one of these set up in my house/office.
> >
> > Hope this helps.
> >
> > Paul
> >
> > --
> > Paul M. Foster
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


Re: [PHP] 1984 (Big Brother)

2010-09-13 Thread Paul M Foster
On Mon, Sep 13, 2010 at 12:47:24PM -0400, tedd wrote:



> When I get rich enough to hire myself, then I'll tell myself what to
> do. Until then, I'm just a worker bee and follow the hive.

Oh, heck, you don't have to wait that long. We'll tell you what to do
for *free*! ;-}

Paul

-- 
Paul M. Foster

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] 1984 (Big Brother)

2010-09-13 Thread tedd

At 12:39 PM -0400 9/13/10, Marc Guay wrote:

 > if steve's idea is something doable.. why don't you consider setting

 up the mysql data dir on some removable media (thumb/flash drive)?


It seems to me that almost no matter what method you choose, you're
going to have to ask the client to do something manually - whether
that's logging out of the website, shutting down his computer,
removing a thumb drive, or whatever - so you might as well be upfront
about that and see how he responds.  Provide the different options and
get them to choose one, at some point they'll need to take a bit of
personal responsibility for the management of this paranoid system.

Marc


Marc:

What everyone has suggested, I have done. But the decision remains 
the client's.


When I get rich enough to hire myself, then I'll tell myself what to 
do. Until then, I'm just a worker bee and follow the hive.


Cheers,

tedd
--
---
http://sperling.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] 1984 (Big Brother)

2010-09-13 Thread Marc Guay
> if steve's idea is something doable.. why don't you consider setting
> up the mysql data dir on some removable media (thumb/flash drive)?

It seems to me that almost no matter what method you choose, you're
going to have to ask the client to do something manually - whether
that's logging out of the website, shutting down his computer,
removing a thumb drive, or whatever - so you might as well be upfront
about that and see how he responds.  Provide the different options and
get them to choose one, at some point they'll need to take a bit of
personal responsibility for the management of this paranoid system.

Marc

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] 1984 (Big Brother)

2010-09-13 Thread viraj
hi tedd,
if steve's idea is something doable.. why don't you consider setting
up the mysql data dir on some removable media (thumb/flash drive)?

so the boss can pull it off if he is going home. and it's easy to
detect this in code and display a message to system users, something
similar to that 'mysql server has gone away' message. (boss has gone
away) :)

~viraj

On Mon, Sep 13, 2010 at 7:13 PM, Bob McConnell  wrote:
> From: tedd
>
>> At 9:10 AM -0400 9/13/10, Steve Staples wrote:
>>>here's a silly idea...
>>>
>>>put the database on his computer (or the entire app).  that way, when
>>>he's *there* he is logged in.  if the computer is off, he's not there,
>>>the app wont work (and the database).
>>
>> Silly or not, that *would* work.
>>
>> Now I have to figure out how to do that.
>
> This may be the only way to do it, but it shouldn't be too hard to
> figure out. If he turns off the computer every time he leaves his desk,
> it can be installed anywhere, even as a service. But if he leaves the
> computer on, it has to be on his desktop, probably with an entry in his
> Start directory to start it when he logs in. But he has to actually log
> out of the desktop to block access, not just leave it in the screen
> saver.
>
> Bob McConnell
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] 1984 (Big Brother)

2010-09-13 Thread Bob McConnell
From: tedd

> At 11:55 PM -0400 9/12/10, Paul M Foster wrote:
>>
>>I hate to seem flippant, but here would be my conversation with this
>>customer:
>>
>>Customer: "My employees got access to the database while I was gone
>>yesterday!"
>>
>>Consultant: "Well, let's see. Oh, it appears you didn't properly log
>>out."
>>
>>Customer: "Yes, but I was *gone*. They weren't supposed to be able to
>>access the database unless I'm *here*."
>>
>>Consultant: "The only way we know that is if you log in and log out
>>properly. Now, if you like, we can put a nanny-cam in your office, and
>>whenever you're not there (like in the bathroom), the whole thing
shuts
>>down. That will cost $x. Your choice. We've been working on the
>>mind-reading extension to PHP, but it's not finished yet."
> 
> Customer: Thanks for your opinion. We'll be in touch.
> 
> Customer to his secretary: Let's find someone who knows how to do
this.

Anybody that tells him it can be done is lying through their teeth and
will just be stealing his money. He probably deserves what he gets in
this case.

Bob McConnell

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] 1984 (Big Brother)

2010-09-13 Thread Bob McConnell
From: tedd

> At 9:10 AM -0400 9/13/10, Steve Staples wrote:
>>here's a silly idea...
>>
>>put the database on his computer (or the entire app).  that way, when
>>he's *there* he is logged in.  if the computer is off, he's not there,
>>the app wont work (and the database).
> 
> Silly or not, that *would* work.
> 
> Now I have to figure out how to do that.

This may be the only way to do it, but it shouldn't be too hard to
figure out. If he turns off the computer every time he leaves his desk,
it can be installed anywhere, even as a service. But if he leaves the
computer on, it has to be on his desktop, probably with an entry in his
Start directory to start it when he logs in. But he has to actually log
out of the desktop to block access, not just leave it in the screen
saver.

Bob McConnell

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] 1984 (Big Brother)

2010-09-13 Thread tedd

At 11:55 PM -0400 9/12/10, Paul M Foster wrote:


I hate to seem flippant, but here would be my conversation with this
customer:

Customer: "My employees got access to the database while I was gone
yesterday!"

Consultant: "Well, let's see. Oh, it appears you didn't properly log
out."

Customer: "Yes, but I was *gone*. They weren't supposed to be able to
access the database unless I'm *here*."

Consultant: "The only way we know that is if you log in and log out
properly. Now, if you like, we can put a nanny-cam in your office, and
whenever you're not there (like in the bathroom), the whole thing shuts
down. That will cost $x. Your choice. We've been working on the
mind-reading extension to PHP, but it's not finished yet."


Customer: Thanks for your opinion. We'll be in touch.

Customer to his secretary: Let's find someone who knows how to do this.

Cheers,

tedd

--
---
http://sperling.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] 1984 (Big Brother)

2010-09-13 Thread tedd

At 9:10 AM -0400 9/13/10, Steve Staples wrote:

here's a silly idea...

put the database on his computer (or the entire app).  that way, when
he's *there* he is logged in.  if the computer is off, he's not there,
the app wont work (and the database).

Steve


Silly or not, that *would* work.

Now I have to figure out how to do that.

Thanks,

tedd

--
---
http://sperling.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] 1984 (Big Brother)

2010-09-13 Thread Ashley Sheridan
On Mon, 2010-09-13 at 09:10 -0400, Steve Staples wrote:

> here's a silly idea...
> 
> put the database on his computer (or the entire app).  that way, when
> he's *there* he is logged in.  if the computer is off, he's not there,
> the app wont work (and the database).
> 
> Steve
> 
> 
> 
> On Mon, 2010-09-13 at 11:26 +0100, Richard Quadling wrote:
> > On 12 September 2010 17:32, tedd  wrote:
> > > Hi gang:
> > >
> > > I have a client who wants his employees' access to their online business
> > > database restricted to only times when he is logged on. (Don't ask why)
> > >
> > > In other words, when the boss is not logged on, then his employees cannot
> > > access the business database in any fashion whatsoever including checking 
> > > to
> > > see if the boss is logged on, or not. No access whatsoever!
> > >
> > > Normally, I would just set up a field in the database and have that set to
> > > "yes" or "no" as to if the employees could access the database, or not. 
> > > But
> > > in this case, the boss does not want even that type of access to the
> > > database permitted. Repeat -- No access whatsoever!
> > >
> > > I was thinking of the boss' script writing to a file that accomplished the
> > > "yes" or "no" thing, but if the boss did not log off properly then the 
> > > file
> > > would remain in the "yes" state allowing employees undesired access. That
> > > would not be acceptable.
> > >
> > > So, what methods would you suggest?
> > >
> > > Cheers,
> > >
> > > tedd
> > 
> > What operating system is he using?
> > 
> > Does he (for example), log into his computer and logoff/shutdown when
> > he goes home?
> > 
> > If he is using Windows (and I'm sure there are many ways to achieve
> > this), then in the Startup folder, a small PHP script which sets a
> > flag "I'm here", would allow the DB to know he's at least logged in.
> > 
> > There are different ways to do this.
> > http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/Windows/XP/Q_21195727.html
> > covers login/logout/startup/shutdown.
> > 
> > 
> > Do they have a clock card system for clocking in/out the building?
> > Could you read the database that the clockings are logged in? An odd
> > number for the day = he's in, even = he's out, missed clocking =
> > screwed/guess.
> > 
> > Ideally you want to "hook" into his normal activity if you can.
> > 
> > 
> > 
> > -- 
> > Richard Quadling
> > Twitter : EE : Zend
> > @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY
> > 
> 
> 
> 


That's a genius idea!

Thanks,
Ash
http://www.ashleysheridan.co.uk




Re: [PHP] 1984 (Big Brother)

2010-09-13 Thread Steve Staples
here's a silly idea...

put the database on his computer (or the entire app).  that way, when
he's *there* he is logged in.  if the computer is off, he's not there,
the app wont work (and the database).

Steve



On Mon, 2010-09-13 at 11:26 +0100, Richard Quadling wrote:
> On 12 September 2010 17:32, tedd  wrote:
> > Hi gang:
> >
> > I have a client who wants his employees' access to their online business
> > database restricted to only times when he is logged on. (Don't ask why)
> >
> > In other words, when the boss is not logged on, then his employees cannot
> > access the business database in any fashion whatsoever including checking to
> > see if the boss is logged on, or not. No access whatsoever!
> >
> > Normally, I would just set up a field in the database and have that set to
> > "yes" or "no" as to if the employees could access the database, or not. But
> > in this case, the boss does not want even that type of access to the
> > database permitted. Repeat -- No access whatsoever!
> >
> > I was thinking of the boss' script writing to a file that accomplished the
> > "yes" or "no" thing, but if the boss did not log off properly then the file
> > would remain in the "yes" state allowing employees undesired access. That
> > would not be acceptable.
> >
> > So, what methods would you suggest?
> >
> > Cheers,
> >
> > tedd
> 
> What operating system is he using?
> 
> Does he (for example), log into his computer and logoff/shutdown when
> he goes home?
> 
> If he is using Windows (and I'm sure there are many ways to achieve
> this), then in the Startup folder, a small PHP script which sets a
> flag "I'm here", would allow the DB to know he's at least logged in.
> 
> There are different ways to do this.
> http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/Windows/XP/Q_21195727.html
> covers login/logout/startup/shutdown.
> 
> 
> Do they have a clock card system for clocking in/out the building?
> Could you read the database that the clockings are logged in? An odd
> number for the day = he's in, even = he's out, missed clocking =
> screwed/guess.
> 
> Ideally you want to "hook" into his normal activity if you can.
> 
> 
> 
> -- 
> Richard Quadling
> Twitter : EE : Zend
> @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY
> 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Standalone WebServer for PHP

2010-09-13 Thread Steve Staples
Wow... this thread SURE went WAY off my original topic...


All I was looking for, was a "webserver" that would serve "PHP" pages,
that was not "installed" on the machine.   Now, if the machine was *nix
or Windose, it didn't matter.

I know in Python, you just have to install python, and then you can use
Cherrypy (but i dont know python, nor do i want to create the app i am
creating with a language i dont full know/understand).

Anyway, I spent a bit of time on the interwebs this weekend, and after
trying just about every one i could find, I am just going to go with
XAMPP, and remove all the stuff i dont need, and trim some fat, and
remove all the hard links to the /opt/lampp directory in linux, and
figure out what it is in windose later...

anyway, thanks for all the ideas.

Steve.


On Sun, 2010-09-12 at 22:37 -0400, Paul M Foster wrote:
> On Sun, Sep 12, 2010 at 02:07:12PM -0400, tedd wrote:
> 
> > At 1:47 PM -0400 9/12/10, Jason Pruim wrote:
> > >>On Sep 12, 2010, at 1:33 PM, tedd wrote:
> > >>So, can I do what I do (i.e., programming) without having a host?
> > >>Can I install a local server at my clients location and interface
> > >>all their computers to use the server without them ever being
> > >>connected to the Internet?
> > >
> > >I may not know all the possibilities but the only way I can think of
> > >to accomplish that  would be to have a server setup in their office
> > >with a bank of modems and have everyone call into the server.
> > >Basically like an old school internet provider.
> > >
> > >If the main server can be secured to your clients liking there are
> > >ways that it can be on the net and still as safe as possible... But
> > >obviously not as safe as hard lines being dialed in...
> > >
> > >You'ld also have to take into account possibly long distance charges
> > >if everyone wasn't local...
> > 
> > Forget modems or other such outside access -- everything would be
> > done internally with computers and users being physically located
> > within the office's physical location.
> > 
> > So, could a server be set up in an office that would run
> > web-languages such that users in the office could access their server
> > and run scripts using browsers?
> 
> I just think I couldn't possibly be fully understanding what you're
> asking. But in case I *do* understand it, it would be like this:
> 
> Set up a switch in the server room and connect everyone to it. Connect
> the switch to the internal webserver. Give the webserver an internal
> (non-routable) IP and hostname. Anyone can access it via
> http://internal_hostname/my_script.php
> 
> No one outside the LAN can access it, something you can enforce with
> Apache or with iptables (Linux).
> 
> I have one of these set up in my house/office.
> 
> Hope this helps.
> 
> Paul
> 
> -- 
> Paul M. Foster
> 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Joke [WAS: Counting Children!]

2010-09-13 Thread Michelle Konzack
Hello Sridhar Pandurangiah,

how women and children do you have, that you
need a program, which count it for you?  :-D

Thanks, Greetings and nice Day/Evening
Michelle Konzack

-- 
# Debian GNU/Linux Consultant ##
   Development of Intranet and Embedded Systems with Debian GNU/Linux

itsyst...@tdnet France EURL   itsyst...@tdnet UG (limited liability)
Owner Michelle KonzackOwner Michelle Konzack

Apt. 917 (homeoffice)
50, rue de Soultz Kinzigstraße 17
67100 Strasbourg/France   77694 Kehl/Germany
Tel: +33-6-61925193 mobil Tel: +49-177-9351947 mobil
Tel: +33-9-52705884 fix

  
 

Jabber linux4miche...@jabber.ccc.de
ICQ#328449886

Linux-User #280138 with the Linux Counter, http://counter.li.org/


signature.pgp
Description: Digital signature


Re: [PHP] 1984 (Big Brother)

2010-09-13 Thread Richard Quadling
On 12 September 2010 17:32, tedd  wrote:
> Hi gang:
>
> I have a client who wants his employees' access to their online business
> database restricted to only times when he is logged on. (Don't ask why)
>
> In other words, when the boss is not logged on, then his employees cannot
> access the business database in any fashion whatsoever including checking to
> see if the boss is logged on, or not. No access whatsoever!
>
> Normally, I would just set up a field in the database and have that set to
> "yes" or "no" as to if the employees could access the database, or not. But
> in this case, the boss does not want even that type of access to the
> database permitted. Repeat -- No access whatsoever!
>
> I was thinking of the boss' script writing to a file that accomplished the
> "yes" or "no" thing, but if the boss did not log off properly then the file
> would remain in the "yes" state allowing employees undesired access. That
> would not be acceptable.
>
> So, what methods would you suggest?
>
> Cheers,
>
> tedd

What operating system is he using?

Does he (for example), log into his computer and logoff/shutdown when
he goes home?

If he is using Windows (and I'm sure there are many ways to achieve
this), then in the Startup folder, a small PHP script which sets a
flag "I'm here", would allow the DB to know he's at least logged in.

There are different ways to do this.
http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/Windows/XP/Q_21195727.html
covers login/logout/startup/shutdown.


Do they have a clock card system for clocking in/out the building?
Could you read the database that the clockings are logged in? An odd
number for the day = he's in, even = he's out, missed clocking =
screwed/guess.

Ideally you want to "hook" into his normal activity if you can.



-- 
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Disabling an extension on a perdir basis.

2010-09-13 Thread Richard Quadling
On 12 September 2010 09:19, David Robley  wrote:
> Richard Quadling wrote:
>
>> On 11 September 2010 20:24, Jim Lucas  wrote:
>>> As I thought, looking through the docs, it looks like the only way to set
>>> the options that are only settable via the php.ini file is to use a per
>>> directory php.ini file.  But, the problem with that is, it only works
>>> with the CGI/FASTCGI SAPI version of php.  It won't work with the apache
>>> mod version.
>>>
>>> So, I guess the question back to you is, what is your setup like?  And if
>>> it isn't CGI/FASTCGI SAPI are you willing to change to that setup?
>>>
>>> Read More: http://www.php.net/manual/en/configuration.file.per-user.php
>>
>> Thanks for that. FastCGI. Will do some more work on it now.
>>
>>
> If you are wanting to disable parsing of php files on a per-directory basis,
> you can do this via .htaccess using
>
> php_flag engine 1|0 (or on|off if you prefer)
>
> http://php.net/manual/en/apache.configuration.php#ini.engine Rather well
> hidden - took me a few minutes to dig it out :-)
>
>
>
> Cheers
> --
> David Robley
>
> If you would know a man, observe how he treats a cat.
> Today is Setting Orange, the 36th day of Bureaucracy in the YOLD 3176.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
I'm helping someone else, so not my setup. They want to disable the
gmagick extension.

I'm waiting for him to get back to me on system setup.

I'm not exactly sure why this extension requires disabling in a single
directory ...

All things I should have asked first, but my first impression was that
there was no way to do a ...

-extension=php_gmagick.dll (or .so).

I'm thinking about a shared hosting where a user may have a conflict
between their own classes and an extension's.

Namespaces could be the answer here, but you can't just put a 1 liner
in and have all the code fixed.






-- 
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] New to PHP and the list

2010-09-13 Thread kranthi
> Is MAX_FILE_SIZE passed to PHP as $MAX_FILE_SIZE?
only if register_golbals is set to ON in php.ini. This is a very bad
practice and should be avoided. Use $_POST['MAX_FILE_SIZE'] instead.
But in this case dont use the post variable also. define a constant in
your configuration file and use that constant. The only use of
MAX_FILE_SIZE  is to inform the browser that "dont allow the user to
upload files which are > MAX_FILE_SIZE".

> 
> $MAX_FILE_SIZE = 3;
>
> echo <<<_END
> 
>     
>     
>     
>     Send this file: 
>     
> 
> <<<_END
Nope, you cant. You have to mention the value attribute of a hidden field

> I'm also concerned that in the first instance, a malicious user can
> modify the value and I will be hosed. Am I correct?
A malicious user can ALWAYS modify the data. You will have to always
validate every input field.

> echo <<<_END
> 
>
>
>
>Send this file: 
>
> 
> <<<_END
i did not understand this echo <<<_END means that you are in php so
why do you need a  ?

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Counting Children!

2010-09-13 Thread Sridhar Pandurangiah

Hi

I have an XML generated by another computer application. The format is
as below. (Don't worry about the data in the XML. Its the test
data).

I am able to locate the correct member bill using XPATH.
However I have hit a bottleneck. I am unable to echo all the  
elements. This is what happens


$row = simplexml_load_string($member->asXML());

echo $line->particular1;
echo $line->amount1;
echo $line->particular2;
echo $line->amount2;

Echoes the first  element of the member bill. If I add the same 
set of statements it echoes the second  element and so on. But 
then if I put the following code which I feel is correct

$row = simplexml_load_string($member->asXML());

foreach ($row->line as $line);
{
echo $line->particular1;
echo $line->amount1;
echo $line->particular2;
echo $line->amount2;
}

Echoes only the last  element of the member. Can someone tell me 
what's wrong


-The XML file 
-



The Great Eastern Club
Anna Road
Madras
BILL

A0099
Bill no. : A0099/APRIL 10
Raman C V
Run date : 03/05/2010
NO 33,MUGAPPAIR ROAD,
PADI,
CHENNAI
600032
9840012345
STATEMENT OF ACCOUNTS AND BILL FOR THE MONTH OF
APRIL-2010
Particulars
Debit
Receivables
Credit

Opening Balance
275.14
-
0.00


CHARGES
33.09


MINIMUM USAGE
220.60


SUBSCRIPTION CHARGES
220.60


WATER CHARGE
22.06


Total Debit
771.49
Total Credit
0.00


Amount to be Received
771.49

Hereafter no reminders will be sent for payment of
monthly/Arrears bills.


A0100
Bill no. : A0100/APRIL 10
Sandeep
Run date : 03/05/2010
NO 12,
TNAGAR,
CHENNAI
600017
9840012365
STATEMENT OF ACCOUNTS AND BILL FOR THE MONTH OF
APRIL-2010
Particulars
Debit
Receivables
Credit

Opening Balance
496.38
-
0.00


ENTERTAINMENT CHARGES
33.09
17/06/2010 CASH 
PCR/000544/10-11
124.00


MINIMUM USAGE
124.00


SUBSCRIPTION CHARGES
220.60


WATER CHARGE
22.06


Total Debit
896.13
Total Credit
124.00


Amount to be Received
772.13

Hereafter no reminders will be sent for payment of
monthly/Arrears bills.



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] 1984 (Big Brother)

2010-09-13 Thread kranthi
i m not sure if i usderstood your question completely.
by database you mean something like phpmyadmin, right ?

i would save the latest session id of the boss in a file, and every
time an employee tries to log in, verify the time stamp of the session
file in the tmp folder.
and if the boss logs out... clear off the tmp folder to ensure that
the employees dosent have further access.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Standalone WebServer for PHP

2010-09-13 Thread Dotan Cohen
On Sun, Sep 12, 2010 at 20:07, tedd  wrote:
> Forget modems or other such outside access -- everything would be done
> internally with computers and users being physically located within the
> office's physical location.
>
> So, could a server be set up in an office that would run web-languages such
> that users in the office could access their server and run scripts using
> browsers?
>

Just connect them to a router and don't connect the router to the WAN.
Each machine will get it's own IP address (assuming that the router is
running a DHCP server).

-- 
Dotan Cohen

http://gibberish.co.il
http://what-is-what.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Standalone WebServer for PHP

2010-09-13 Thread Dotan Cohen
On Sun, Sep 12, 2010 at 18:55, tedd  wrote:
> A question, to clarify my fuzzy thinking about such things:
>
> Can a business have a server connected to the Internet but limit access to
> just their employees? I don't mean a password protected scheme, but rather
> the server being totally closed to the outside world other than to their
> internal employees? Or is this something that can only be provided by a LAN
> with no Internet connection?
>

Filter on IP address. Not foolproof, but mostly there.

-- 
Dotan Cohen

http://gibberish.co.il
http://what-is-what.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Standalone WebServer for PHP

2010-09-13 Thread Pete Ford

On 12/09/10 18:33, tedd wrote:

At 5:57 PM +0100 9/12/10, Ashley Sheridan wrote:

On Sun, 2010-09-12 at 12:55 -0400, tedd wrote:


Can a business have a server connected to the Internet but limit
access to just their employees? I don't mean a password protected
scheme, but rather the server being totally closed to the outside
world other than to their internal employees? Or is this something
that can only be provided by a LAN with no Internet connection?



Not entirely sure what you're asking, but could you maybe achieve
something like this with a WAN using a VPN?

Thanks,
Ash


Ash:

I'm sure this is an obvious question for many on this list, but I'm not
above showing my ignorance.

I guess what I am asking -- if a client wanted an application written
(in web languages) so that their employees could link all their
different computers together and share/use information using browsers,
is that possible using a server that is not connected to the Internet?

Look, I know that I can solve my clients problems by finding a host and
writing scripts to do what they want -- that's not a problem. But
everything I do is open to the world. Sure I can provide some level of
security, but nothing like the security that can be provided behind
closed and locked doors.

So, can I do what I do (i.e., programming) without having a host? Can I
install a local server at my clients location and interface all their
computers to use the server without them ever being connected to the
Internet?

Maybe I should ask my grandson. :-)

Cheers,

tedd




If the network is set up (as most business and home networks are these days) to 
use Network Address Translation (NAT) at the connection point to the world, then 
you shold be able to achieve this.
NAT is where you have an internal network using private addresses (often in the 
192.168.xxx.xxx range) but all outgoing traffic appears on the internet to come 
from one public address.


So you configure your web server to accept requests from only the internal 
addresses. With Apache you could do this on a per-directory basis, even, so the 
web server could have public content (visible to all client addresses) and then 
have private content in subdirectories which only accept clients on the internal 
network addresses.


There is a possible loophole due to IP address spoofing, but I suspect that your 
gateway device (firewall, ADSL or cable router that connects you to the world) 
will block those sort of clients.


--
Peter Ford, Developer phone: 01580 89 fax: 01580 893399
Justcroft International Ltd.  www.justcroft.com
Justcroft House, High Street, Staplehurst, Kent   TN12 0AH   United Kingdom
Registered in England and Wales: 2297906
Registered office: Stag Gates House, 63/64 The Avenue, Southampton SO17 1XS

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php