Sep. 23rd, 2001

alexpgp: (Default)
Then again, maybe not so lazy.

Galina and I pitched in to fill up our two rolling trash containers with stuff that'd been clogging the garage for a while. Later, Drew and I rolled them down the driveway and positioned them for tomorrow's pickup. Let me tell you, rolling a heavy container down a gravel driveway is not much fun, especially as these vehicles were not built with this kind of treatment in mind.

I fell asleep last night soon after my post, only to wake up at midnight. I spent a couple of hours with MySQL and trying to understand why sometimes a user (e.g., root) can select a database (e.g., use new_database), and why other users (not root) cannot.

The best explanation I can come up with is that unless you "log in" as someone that has some kind of privileges set in the 'users' table of the 'mysql' database, you cannot select a database even though there is no (or does not appear to be any) specific attribute for this privilege.

The other major hurdle I am trying to overcome is to do authentication inside of a PHP script. The code looks downright impossible, in terms of conventional control flow, and reading the W3 RFCs on the matter are the best thing I can recommend for insomnia. When I try to execute the script using lynx, it appears as though the browser simply will not accept my inputs for username and password, or something along those lines. Consequently, I can't tell how the code is supposed to execute.

Farblegarg, and other appropriate comments.

When not abusing the electrons in my computer, I spent some time helping Drew with his math assignment and sat with Galina to have some lunch and watch part of the massive prayer meeting telecast from New York's Yankee Stadium. It was good to see clerics of so many faiths stand up and say their piece, and as unrealistic as this might sound, perhaps it would be good for such kinds of events to occur routinely, so that people can see and hear "others" and come to realize that, perhaps, gulfs are not as wide as perceived from within a group.

In other news, I have two small translations to do. One of them is a divorce decree, which always gives me the willies, because bureaucrats in Russia have never heard of printing entries on such forms. Such translations thus become puzzles of a sort, as you end up trying to figure out some portion of the entries (is the patronymic Kimovich or Klimovich, or something entirely different?).

There's lots of paperwork to take care of this week, too. Invoices to send. Taxes to file. Records to straighten. I got news yesterday that the post office will be doing an audit of our operation sometime in the next couple of weeks, so I need to make sure we audit ourselves in preparation for that event. Aside from the obvious stuff (the financials), I think I might call tomorrow and find out just what else they might ask about, so as not to be caught possibly flat-footed.

Enough jawing, time to go work.

Cheers...
alexpgp: (Default)
The following is an example script that illustrates what's bugging me:
<?
if ( (!isset($PHP_AUTH_USER)) || 
     (!isset($PGP_AUTH_PW)) || 
     ($PHP_AUTH_USER != 'foo') ||
     ($PHP_AUTH_PW != 'bar') ) {
   header('WWW-Authenticate: Basic realm="Baz"');
   header('HTTP/1.0 401 Unauthorized');
   die('Authorization required');
   }
   else {
   echo 'Success!';
   }
?>
The way I understand what happens upon executing this script, if either global variable $PHP_AUTH_USER or $PHP_AUTH_PW is not 'true', or if the former isn't 'foo' or the latter isn't 'bar', then the script causes an authentication dialog box to appear on the browser's screen, asking for a user name and a password.

What puzzles me is that upon executing the two calls to the PHP header() function, I don't see how one can avoid the call to die(), which causes the message to be output and the script to exit. The only way this makes any sense at all is if, upon entering a user name and password, somehow execution of the script starts from the beginning.

Hmmm. I can't seem to get this to work on the eSlate using lynx as my browser, despite the fact that the Apache web server on the laptop runs PHP as a module (required if this type of authentication is to work). Who knows? Maybe it's because I'm using lynx.

In any event, what I am seeing in lynx is an immediate rejection of any name and password I enter, with a displayed query as to whether I want to try again. After a few rejected attempts to enter a name and password, I finally respond in the negative and am then prompted as to whether I wish to see the 401 message. Responding 'y' displays the 'Authentication required' message.

Turning elsewhere, I find my ISP uses a CGI-based PHP server API (which means that the PHP code is not executed by a module from within the web server, but by a separate program). Unfortunately, this PHP configuration does not support this type of authentication.

Ye gods.

Cheers...

P.S. [Update of 24 Sep] While the lack of "direct" authentication support on systems that run PHP as a separate program is a pain, so is having a typo in your test script (a typo I am leaving in this post, BTW, as a reminder). Once I took care of the typo, which I found by deciding to examine the script one more time, running it on my eSlate with lynx worked fine. Next: see if I can make it work with MySQL.
alexpgp: (Default)
Cyrano's "No thank you!" speech - most inspiring - from the Brian Hooker translation of Edmond Rostand's Cyrano de Bergerac:
                    What would you have me do?
Seek for the patronage of some great man,
And like a creeping vine on a tall tree
Crawl upward, where I cannot stand alone?
No thank you! Dedicate, as others do,
Poems to pawnbrokers? Be a buffoon
In the vile hope of teasing out a smile
On some cold face? No thank you! Eat a toad
For breakfast every morning? Make my knees
Callous, and cultivate a supple spine,--
Wear out my belly groveling in the dust?
No thank you! Scratch the back of any swine
That roots up gold for me? Tickle the horns
Of Mammon with my left hand, while my right
Too proud to know his partner's business,
Takes in the fee? No thank you! Use the fire
God gave me to burn incense all day long
Under the nose of wood and stone? No thank you!
Shall I go leaping into ladies' laps
And licking fingers?--or--to change the form--
Navigating with madrigals for oars,
My sails full of the sighs of dowagers?
No thank you! Publish verses at my own
Expense? No thank you! Be the patron saint
Of a small group of literary souls
Who dine together every Tuesday? No
I thank you! Shall I labor night and day
To build a reputation on one song,
And never write another? Shall I find
True genius only among Geniuses,
Palpitate over little paragraphs,
And struggle to insinuate my name
In the columns of the Mercury?
No thank you! Calculate, scheme, be afraid,
Love more to make a visit than a poem,
Seek introductions, favors, influences?--
No thank you! No, I thank you! And again
I thank you!--But...
                    To sing, to laugh, to dream,
To walk in my own way and be alone,
Free, with an eye to see things as they are,
A voice that means manhood--to cock my hat
Where I choose-- At a word, a Yes, a No,
To fight--or write. To travel any road
Under the sun, under the stars, nor doubt
If fame or fortune lie beyond the bourne--
Never to make a line I have not heard
In my own heart; yet, with all modesty
To say: "My soul, be satisfied with flowers,
With fruit, with weeds even; but gather them
In the one garden you may call your own."
So, when I win some triumph, by some chance,
Render no share to Caesar--in a word,
I am too proud to be a parasite,
And if my nature wants the germ that grows
Towering to heaven like the mountain pine,
Or like the oak, sheltering multitudes--
I stand, not high as it may be--but alone!
See also:

An old post with Rostand's original French of this soliloquy.
An even older post with the Guillemard translation of Cyrano's words at the end of the post.

Cheers...

Profile

alexpgp: (Default)
alexpgp

January 2018

S M T W T F S
  1 2 3456
7 8910111213
14 15 16 17181920
21222324252627
28293031   

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Aug. 26th, 2025 08:44 pm
Powered by Dreamwidth Studios