1. Trang chủ
  2. » Công Nghệ Thông Tin

Secure PHP Development- P5 pps

5 257 0

Đang tải... (xem toàn văn)

THÔNG TIN TÀI LIỆU

RESOURCE_KEYWORD table . . . . . . . . . . . . . . . . . . . . . . . . 361 RESOURCE_VISITOR table . . . . . . . . . . . . . . . . . . . . . . . . . . 361 Designing and Implementing the Internet Resource Manager Application Classes . . . . . . . . . . . . . . . . . . . . . . 362 Designing and implementing the IrmCategory class . . . . . . . . . 362 Designing and implementing the IrmResource class . . . . . . . . . 364 Designing and implementing the Message class . . . . . . . . . . . 368 Creating Application Configuration Files . . . . . . . . . . . . . . 369 Creating the main configuration file . . . . . . . . . . . . . . . . . . . 369 Creating a messages file . . . . . . . . . . . . . . . . . . . . . . . . . . . 373 Creating an errors file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 373 Creating Application Templates . . . . . . . . . . . . . . . . . . . . . 373 Creating a Category Manager Application . . . . . . . . . . . . . 374 run() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375 addDriver() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375 modifyDriver() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375 addCategory() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375 modifyCategory() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 376 deleteCategory() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 376 displayModifyCategoryMenu() . . . . . . . . . . . . . . . . . . . . . . . 377 displayAddCategoryMenu() . . . . . . . . . . . . . . . . . . . . . . . . . 377 populateCategory() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 378 populateSubCategory() . . . . . . . . . . . . . . . . . . . . . . . . . . . . 378 showMenu() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 378 showWithTheme() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 379 authorize() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 379 Creating a Resource Manager Application . . . . . . . . . . . . . 379 run() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 380 addDriver() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 380 modifyDriver() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 380 populateCategory() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 380 populateSubCategory() . . . . . . . . . . . . . . . . . . . . . . . . . . . . 381 showAddMenu() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 381 addResource() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 382 showModifyMenu() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 382 modifyResource() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 383 delete() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 383 displayDescription() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384 selectResource() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384 displayWithTheme() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384 authorize() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385 Creating a Resource Tracking Application . . . . . . . . . . . . . 385 run() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385 keepTrack() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385 authorize() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 386 Contents xix 01549669 FM.qxd 4/4/03 9:23 AM Page xix Creating a Search Manager Application . . . . . . . . . . . . . . 386 run() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 386 populateCategory() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 386 populateSubCategory() . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387 populateResource() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387 showMenu() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387 displaySearchResult() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 388 sortAndDisplay() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389 displaySearResultNextandPrevious() . . . . . . . . . . . . . . . . . . . 389 showTopRankingResource() . . . . . . . . . . . . . . . . . . . . . . . . . 390 showMostVisitedResource() . . . . . . . . . . . . . . . . . . . . . . . . . 390 showWithTheme() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 390 authorize() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391 sortByResourceTitle() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391 sortByResourceAddedBy() . . . . . . . . . . . . . . . . . . . . . . . . . . 391 sortByResourceRating() . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391 sortByResourceVisitor() . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391 Installing an IRM on Your Intranet . . . . . . . . . . . . . . . . . . 391 Testing IRM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393 Security Concerns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401 Chapter 12 Online Help System . . . . . . . . . . . . . . . . . . . . . . . . . . . 403 Functionality Requirements . . . . . . . . . . . . . . . . . . . . . . . . 403 Understanding the Prerequisites . . . . . . . . . . . . . . . . . . . . 404 Designing and Implementing the Help Application Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404 Designing and implementing the Help class . . . . . . . . . . . . . . 404 Creating Application Configuration Files . . . . . . . . . . . . . . 415 Creating a main configuration file . . . . . . . . . . . . . . . . . . . . 415 Creating a messages file . . . . . . . . . . . . . . . . . . . . . . . . . . . 417 Creating an error message file . . . . . . . . . . . . . . . . . . . . . . . 417 Creating Application Templates . . . . . . . . . . . . . . . . . . . . . 417 Creating the Help Indexing Application . . . . . . . . . . . . . . . 418 run() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 419 makeIndex() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 419 getMapHash() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 420 authorize() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 420 Creating the Help Application . . . . . . . . . . . . . . . . . . . . . . 420 run() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 420 authorize() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 421 getCommand() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 421 getAppInfo() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 421 showHelp() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 421 displayOutput() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 422 doSearch() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423 Installing Help Applications . . . . . . . . . . . . . . . . . . . . . . . 423 xx Contents 01549669 FM.qxd 4/4/03 9:23 AM Page xx Testing the Help System . . . . . . . . . . . . . . . . . . . . . . . . . . 424 Security Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . 427 Restricting access to makeindex.php script . . . . . . . . . . . . . . . 428 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 428 Part III Developing E-mail Solutions Chapter 13 Tell-a-Friend System . . . . . . . . . . . . . . . . . . . . . . . . . . 431 Functionality Requirements . . . . . . . . . . . . . . . . . . . . . . . . 431 Understanding Prerequisites . . . . . . . . . . . . . . . . . . . . . . . 433 Designing the Database . . . . . . . . . . . . . . . . . . . . . . . . . . . 433 TAF_FORM Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 433 TAF_FRM_BANNED_IP Table . . . . . . . . . . . . . . . . . . . . . . . . 434 TAF_FRM_OWNER_IP Table . . . . . . . . . . . . . . . . . . . . . . . . . 434 TAF_MESSAGE Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434 TAF_MSG_OWNER_IP Table . . . . . . . . . . . . . . . . . . . . . . . . 434 TAF_SUBMISSION Table . . . . . . . . . . . . . . . . . . . . . . . . . . . 434 TAF_SUBSCRIPTION Table . . . . . . . . . . . . . . . . . . . . . . . . . . 434 Designing and Implementing the Tell-a-Friend Application Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435 Designing and implementing the Form class . . . . . . . . . . . . . . 436 Designing and implementing the Message class . . . . . . . . . . . 442 Designing and implementing the AccessControl class . . . . . . . 444 Creating Application Configuration Files . . . . . . . . . . . . . . 446 Creating the main configuration file . . . . . . . . . . . . . . . . . . . 446 Creating a Messages file . . . . . . . . . . . . . . . . . . . . . . . . . . . 449 Creating an Errors file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 449 Creating Application Templates . . . . . . . . . . . . . . . . . . . . . 450 Creating the Tell-a-Friend Main Menu Manager Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . 451 run() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 451 displayTAFMenu() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 451 Creating a Tell-a-Friend Form Manager Application . . . . . 452 run() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 452 authorize() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 452 addModifyDriver() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 452 displayAddModifyMenu() . . . . . . . . . . . . . . . . . . . . . . . . . . . 453 addModifyForm() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 453 deleteForm() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 454 Creating a Tell-a-Friend Message Manager Application . . . 454 run() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 454 authorize() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 455 addModifyDriver() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 455 displayAddModifyMenu() . . . . . . . . . . . . . . . . . . . . . . . . . . . 455 addModifyMessage() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 456 deleteMessage() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 456 Contents xxi 01549669 FM.qxd 4/4/03 9:23 AM Page xxi Creating a Tell-a-Friend Form Processor Application . . . . 457 run() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 457 processRequest() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 457 Creating a Tell-a-Friend Subscriber Application . . . . . . . . 458 run() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 458 authorize() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 458 processRequest() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 459 Creating a Tell-a-Friend Reporter Application . . . . . . . . . . 459 run() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 460 generateFormCreatorReport() . . . . . . . . . . . . . . . . . . . . . . . . 460 generateOriginReport() . . . . . . . . . . . . . . . . . . . . . . . . . . . . 460 Installing a Tell-a-Friend System . . . . . . . . . . . . . . . . . . . . 461 Testing the Tell-a-Friend System . . . . . . . . . . . . . . . . . . . . 462 Creating Msg for Friend (Introduction Msg) . . . . . . . . . . . . . . 464 Security Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . 471 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 471 Chapter 14 E-mail Survey System . . . . . . . . . . . . . . . . . . . . . . . . . 473 Functionality Requirements . . . . . . . . . . . . . . . . . . . . . . . . 474 Architecture of the Survey System . . . . . . . . . . . . . . . . . . 475 Designing the Database . . . . . . . . . . . . . . . . . . . . . . . . . . . 477 Designing and Implementing the Survey Classes . . . . . . . . 479 Designing and implementing the Survey Class . . . . . . . . . . . . 479 Designing and implementing the SurveyList Class . . . . . . . . . . 480 Designing and implementing the SurveyForm Class . . . . . . . . 482 Designing and implementing the SurveyResponse Class . . . . . . 483 Designing and implementing the SurveyReport Class . . . . . . . . 484 Designing and Implementing the Survey Applications . . . 484 Developing Survey Manager . . . . . . . . . . . . . . . . . . . . . . . . 485 Developing Survey List Manager . . . . . . . . . . . . . . . . . . . . . 486 Developing Survey Form Manager . . . . . . . . . . . . . . . . . . . . 488 Developing Survey Execution Manager . . . . . . . . . . . . . . . 489 Developing Survey Response Manager . . . . . . . . . . . . . . . . . . 491 Developing Survey Report Manager . . . . . . . . . . . . . . . . . . . 492 Setting Up the Central Survey Configuration File . . . . . . . 493 Setting Up the Interface Template Files . . . . . . . . . . . . . . . 497 Setting Up the Central Survey Messages File . . . . . . . . . . . . . 498 Setting Up the Central Survey Errors File . . . . . . . . . . . . . . . . 498 Creating Survey Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . 499 Testing the Survey System . . . . . . . . . . . . . . . . . . . . . . . . . 500 Security Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . 506 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 506 Chapter 15 E-campaign System . . . . . . . . . . . . . . . . . . . . . . 507 Features of an E-campaign System . . . . . . . . . . . . . . . . . . 507 Architecting an E-campaign System . . . . . . . . . . . . . . . . . 509 Designing an E-campaign Database . . . . . . . . . . . . . . . . . . 511 xxii Contents 01549669 FM.qxd 4/4/03 9:23 AM Page xxii Understanding Customer Database Requirements . . . . . . . 515 Designing E-campaign Classes . . . . . . . . . . . . . . . . . . . . . . 516 Creating a List class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 516 Creating a URL class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 518 Creating a Message class . . . . . . . . . . . . . . . . . . . . . . . . . . . 519 Creating a Campaign class . . . . . . . . . . . . . . . . . . . . . . . . . . 521 Creating a URL Tracking class . . . . . . . . . . . . . . . . . . . . . . . 521 Creating an Unsubscription Tracking class . . . . . . . . . . . . . . . 522 Creating a Report class . . . . . . . . . . . . . . . . . . . . . . . . . . . . 522 Creating Common Configuration and Resource Files . . . . . 523 Creating an e-campaign configuration file . . . . . . . . . . . . . . . 523 Creating an e-campaign messages file . . . . . . . . . . . . . . . . . . 526 Creating an e-campaign errors file . . . . . . . . . . . . . . . . . . . . 526 Creating Interface Template Files . . . . . . . . . . . . . . . . . . . . 526 Creating an E-campaign User Interface Application . . . . . 528 run() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 528 displayMenu() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 528 authorize() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 528 Creating a List Manager Application . . . . . . . . . . . . . . . . . 528 run() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 528 addDriver() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 529 modifyDriver() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 530 authorize() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 530 displayAddListMenu() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 530 displayModListMenu() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 530 modifyList() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 530 modifyDatabaseFieldMap() . . . . . . . . . . . . . . . . . . . . . . . . . . 531 delList() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531 takeMap() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531 addList() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531 addDatabaseFieldMap() . . . . . . . . . . . . . . . . . . . . . . . . . . . . 532 Creating a URL Manager Application . . . . . . . . . . . . . . . . 532 run() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 532 addURLDriver() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 532 authorize() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 532 modifyURLDriver() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 533 delURL() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 534 displayAddURLMenu() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 534 addURL() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 534 displayModifyURLMenu() . . . . . . . . . . . . . . . . . . . . . . . . . . 534 modifyURL() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 534 Creating a Message Manager Application . . . . . . . . . . . . . 535 run() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 536 addDriver() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 536 modifyDriver() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 536 Contents xxiii 01549669 FM.qxd 4/4/03 9:23 AM Page xxiii . Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . 427 Restricting access to makeindex .php script . . . . . . . . . . . . . . . 428 Summary . . . . . . . . . . . . . . . . . . . . . .

Ngày đăng: 07/07/2014, 07:20

Xem thêm: Secure PHP Development- P5 pps

Mục lục

    Is This Book for You?

    How This Book Is Organized

    Tell Us What You Think

    Contents at a Glance

    Chapter 1: Features of Practical PHP Applications

    Features of a Practical PHP Application

    Employing the Features in Applications

    Chapter 2: Understanding and Avoiding Security Risks

    Identifying the Sources of Risk

    Not Revealing Sensitive Information

TÀI LIỆU CÙNG NGƯỜI DÙNG

TÀI LIỆU LIÊN QUAN