@@ -394,10 +394,10 @@ discard block |
||
394 | 394 | 'children' => array( |
395 | 395 | 'extnId' => array('type' => FILE_ASN1_TYPE_OBJECT_IDENTIFIER), |
396 | 396 | 'critical' => array( |
397 | - 'type' => FILE_ASN1_TYPE_BOOLEAN, |
|
398 | - 'optional' => true, |
|
399 | - 'default' => false |
|
400 | - ), |
|
397 | + 'type' => FILE_ASN1_TYPE_BOOLEAN, |
|
398 | + 'optional' => true, |
|
399 | + 'default' => false |
|
400 | + ), |
|
401 | 401 | 'extnValue' => array('type' => FILE_ASN1_TYPE_OCTET_STRING) |
402 | 402 | ) |
403 | 403 | ); |
@@ -452,11 +452,11 @@ discard block |
||
452 | 452 | // technically, default implies optional, but we'll define it as being optional, none-the-less, just to |
453 | 453 | // reenforce that fact |
454 | 454 | 'version' => array( |
455 | - 'constant' => 0, |
|
456 | - 'optional' => true, |
|
457 | - 'explicit' => true, |
|
458 | - 'default' => 'v1' |
|
459 | - ) + $Version, |
|
455 | + 'constant' => 0, |
|
456 | + 'optional' => true, |
|
457 | + 'explicit' => true, |
|
458 | + 'default' => 'v1' |
|
459 | + ) + $Version, |
|
460 | 460 | 'serialNumber' => $CertificateSerialNumber, |
461 | 461 | 'signature' => $AlgorithmIdentifier, |
462 | 462 | 'issuer' => $this->Name, |
@@ -465,31 +465,31 @@ discard block |
||
465 | 465 | 'subjectPublicKeyInfo' => $SubjectPublicKeyInfo, |
466 | 466 | // implicit means that the T in the TLV structure is to be rewritten, regardless of the type |
467 | 467 | 'issuerUniqueID' => array( |
468 | - 'constant' => 1, |
|
469 | - 'optional' => true, |
|
470 | - 'implicit' => true |
|
471 | - ) + $UniqueIdentifier, |
|
468 | + 'constant' => 1, |
|
469 | + 'optional' => true, |
|
470 | + 'implicit' => true |
|
471 | + ) + $UniqueIdentifier, |
|
472 | 472 | 'subjectUniqueID' => array( |
473 | - 'constant' => 2, |
|
474 | - 'optional' => true, |
|
475 | - 'implicit' => true |
|
476 | - ) + $UniqueIdentifier, |
|
473 | + 'constant' => 2, |
|
474 | + 'optional' => true, |
|
475 | + 'implicit' => true |
|
476 | + ) + $UniqueIdentifier, |
|
477 | 477 | // <http://tools.ietf.org/html/rfc2459#page-74> doesn't use the EXPLICIT keyword but if |
478 | 478 | // it's not IMPLICIT, it's EXPLICIT |
479 | 479 | 'extensions' => array( |
480 | - 'constant' => 3, |
|
481 | - 'optional' => true, |
|
482 | - 'explicit' => true |
|
483 | - ) + $this->Extensions |
|
480 | + 'constant' => 3, |
|
481 | + 'optional' => true, |
|
482 | + 'explicit' => true |
|
483 | + ) + $this->Extensions |
|
484 | 484 | ) |
485 | 485 | ); |
486 | 486 | |
487 | 487 | $this->Certificate = array( |
488 | 488 | 'type' => FILE_ASN1_TYPE_SEQUENCE, |
489 | 489 | 'children' => array( |
490 | - 'tbsCertificate' => $TBSCertificate, |
|
491 | - 'signatureAlgorithm' => $AlgorithmIdentifier, |
|
492 | - 'signature' => array('type' => FILE_ASN1_TYPE_BIT_STRING) |
|
490 | + 'tbsCertificate' => $TBSCertificate, |
|
491 | + 'signatureAlgorithm' => $AlgorithmIdentifier, |
|
492 | + 'signature' => array('type' => FILE_ASN1_TYPE_BIT_STRING) |
|
493 | 493 | ) |
494 | 494 | ); |
495 | 495 | |
@@ -512,14 +512,14 @@ discard block |
||
512 | 512 | 'type' => FILE_ASN1_TYPE_SEQUENCE, |
513 | 513 | 'children' => array( |
514 | 514 | 'cA' => array( |
515 | - 'type' => FILE_ASN1_TYPE_BOOLEAN, |
|
516 | - 'optional' => true, |
|
517 | - 'default' => false |
|
518 | - ), |
|
515 | + 'type' => FILE_ASN1_TYPE_BOOLEAN, |
|
516 | + 'optional' => true, |
|
517 | + 'default' => false |
|
518 | + ), |
|
519 | 519 | 'pathLenConstraint' => array( |
520 | - 'type' => FILE_ASN1_TYPE_INTEGER, |
|
521 | - 'optional' => true |
|
522 | - ) |
|
520 | + 'type' => FILE_ASN1_TYPE_INTEGER, |
|
521 | + 'optional' => true |
|
522 | + ) |
|
523 | 523 | ) |
524 | 524 | ); |
525 | 525 | |
@@ -536,29 +536,29 @@ discard block |
||
536 | 536 | 'type' => FILE_ASN1_TYPE_SET, |
537 | 537 | 'children' => array( |
538 | 538 | 'surname' => array( |
539 | - 'type' => FILE_ASN1_TYPE_PRINTABLE_STRING, |
|
540 | - 'constant' => 0, |
|
541 | - 'optional' => true, |
|
542 | - 'implicit' => true |
|
543 | - ), |
|
539 | + 'type' => FILE_ASN1_TYPE_PRINTABLE_STRING, |
|
540 | + 'constant' => 0, |
|
541 | + 'optional' => true, |
|
542 | + 'implicit' => true |
|
543 | + ), |
|
544 | 544 | 'given-name' => array( |
545 | - 'type' => FILE_ASN1_TYPE_PRINTABLE_STRING, |
|
546 | - 'constant' => 1, |
|
547 | - 'optional' => true, |
|
548 | - 'implicit' => true |
|
549 | - ), |
|
545 | + 'type' => FILE_ASN1_TYPE_PRINTABLE_STRING, |
|
546 | + 'constant' => 1, |
|
547 | + 'optional' => true, |
|
548 | + 'implicit' => true |
|
549 | + ), |
|
550 | 550 | 'initials' => array( |
551 | - 'type' => FILE_ASN1_TYPE_PRINTABLE_STRING, |
|
552 | - 'constant' => 2, |
|
553 | - 'optional' => true, |
|
554 | - 'implicit' => true |
|
555 | - ), |
|
551 | + 'type' => FILE_ASN1_TYPE_PRINTABLE_STRING, |
|
552 | + 'constant' => 2, |
|
553 | + 'optional' => true, |
|
554 | + 'implicit' => true |
|
555 | + ), |
|
556 | 556 | 'generation-qualifier' => array( |
557 | - 'type' => FILE_ASN1_TYPE_PRINTABLE_STRING, |
|
558 | - 'constant' => 3, |
|
559 | - 'optional' => true, |
|
560 | - 'implicit' => true |
|
561 | - ) |
|
557 | + 'type' => FILE_ASN1_TYPE_PRINTABLE_STRING, |
|
558 | + 'constant' => 3, |
|
559 | + 'optional' => true, |
|
560 | + 'implicit' => true |
|
561 | + ) |
|
562 | 562 | ) |
563 | 563 | ); |
564 | 564 | |
@@ -605,26 +605,26 @@ discard block |
||
605 | 605 | $AnotherName = array( |
606 | 606 | 'type' => FILE_ASN1_TYPE_SEQUENCE, |
607 | 607 | 'children' => array( |
608 | - 'type-id' => array('type' => FILE_ASN1_TYPE_OBJECT_IDENTIFIER), |
|
609 | - 'value' => array( |
|
610 | - 'type' => FILE_ASN1_TYPE_ANY, |
|
611 | - 'constant' => 0, |
|
612 | - 'optional' => true, |
|
613 | - 'explicit' => true |
|
614 | - ) |
|
608 | + 'type-id' => array('type' => FILE_ASN1_TYPE_OBJECT_IDENTIFIER), |
|
609 | + 'value' => array( |
|
610 | + 'type' => FILE_ASN1_TYPE_ANY, |
|
611 | + 'constant' => 0, |
|
612 | + 'optional' => true, |
|
613 | + 'explicit' => true |
|
614 | + ) |
|
615 | 615 | ) |
616 | 616 | ); |
617 | 617 | |
618 | 618 | $ExtensionAttribute = array( |
619 | 619 | 'type' => FILE_ASN1_TYPE_SEQUENCE, |
620 | 620 | 'children' => array( |
621 | - 'extension-attribute-type' => array( |
|
621 | + 'extension-attribute-type' => array( |
|
622 | 622 | 'type' => FILE_ASN1_TYPE_PRINTABLE_STRING, |
623 | 623 | 'constant' => 0, |
624 | 624 | 'optional' => true, |
625 | 625 | 'implicit' => true |
626 | 626 | ), |
627 | - 'extension-attribute-value' => array( |
|
627 | + 'extension-attribute-value' => array( |
|
628 | 628 | 'type' => FILE_ASN1_TYPE_ANY, |
629 | 629 | 'constant' => 1, |
630 | 630 | 'optional' => true, |
@@ -643,8 +643,8 @@ discard block |
||
643 | 643 | $BuiltInDomainDefinedAttribute = array( |
644 | 644 | 'type' => FILE_ASN1_TYPE_SEQUENCE, |
645 | 645 | 'children' => array( |
646 | - 'type' => array('type' => FILE_ASN1_TYPE_PRINTABLE_STRING), |
|
647 | - 'value' => array('type' => FILE_ASN1_TYPE_PRINTABLE_STRING) |
|
646 | + 'type' => array('type' => FILE_ASN1_TYPE_PRINTABLE_STRING), |
|
647 | + 'value' => array('type' => FILE_ASN1_TYPE_PRINTABLE_STRING) |
|
648 | 648 | ) |
649 | 649 | ); |
650 | 650 | |
@@ -661,63 +661,63 @@ discard block |
||
661 | 661 | 'country-name' => array('optional' => true) + $CountryName, |
662 | 662 | 'administration-domain-name' => array('optional' => true) + $AdministrationDomainName, |
663 | 663 | 'network-address' => array( |
664 | - 'constant' => 0, |
|
665 | - 'optional' => true, |
|
666 | - 'implicit' => true |
|
667 | - ) + $NetworkAddress, |
|
664 | + 'constant' => 0, |
|
665 | + 'optional' => true, |
|
666 | + 'implicit' => true |
|
667 | + ) + $NetworkAddress, |
|
668 | 668 | 'terminal-identifier' => array( |
669 | - 'constant' => 1, |
|
670 | - 'optional' => true, |
|
671 | - 'implicit' => true |
|
672 | - ) + $TerminalIdentifier, |
|
669 | + 'constant' => 1, |
|
670 | + 'optional' => true, |
|
671 | + 'implicit' => true |
|
672 | + ) + $TerminalIdentifier, |
|
673 | 673 | 'private-domain-name' => array( |
674 | - 'constant' => 2, |
|
675 | - 'optional' => true, |
|
676 | - 'explicit' => true |
|
677 | - ) + $PrivateDomainName, |
|
674 | + 'constant' => 2, |
|
675 | + 'optional' => true, |
|
676 | + 'explicit' => true |
|
677 | + ) + $PrivateDomainName, |
|
678 | 678 | 'organization-name' => array( |
679 | - 'constant' => 3, |
|
680 | - 'optional' => true, |
|
681 | - 'implicit' => true |
|
682 | - ) + $OrganizationName, |
|
679 | + 'constant' => 3, |
|
680 | + 'optional' => true, |
|
681 | + 'implicit' => true |
|
682 | + ) + $OrganizationName, |
|
683 | 683 | 'numeric-user-identifier' => array( |
684 | - 'constant' => 4, |
|
685 | - 'optional' => true, |
|
686 | - 'implicit' => true |
|
687 | - ) + $NumericUserIdentifier, |
|
684 | + 'constant' => 4, |
|
685 | + 'optional' => true, |
|
686 | + 'implicit' => true |
|
687 | + ) + $NumericUserIdentifier, |
|
688 | 688 | 'personal-name' => array( |
689 | - 'constant' => 5, |
|
690 | - 'optional' => true, |
|
691 | - 'implicit' => true |
|
692 | - ) + $PersonalName, |
|
689 | + 'constant' => 5, |
|
690 | + 'optional' => true, |
|
691 | + 'implicit' => true |
|
692 | + ) + $PersonalName, |
|
693 | 693 | 'organizational-unit-names' => array( |
694 | - 'constant' => 6, |
|
695 | - 'optional' => true, |
|
696 | - 'implicit' => true |
|
697 | - ) + $OrganizationalUnitNames |
|
694 | + 'constant' => 6, |
|
695 | + 'optional' => true, |
|
696 | + 'implicit' => true |
|
697 | + ) + $OrganizationalUnitNames |
|
698 | 698 | ) |
699 | 699 | ); |
700 | 700 | |
701 | 701 | $ORAddress = array( |
702 | 702 | 'type' => FILE_ASN1_TYPE_SEQUENCE, |
703 | 703 | 'children' => array( |
704 | - 'built-in-standard-attributes' => $BuiltInStandardAttributes, |
|
705 | - 'built-in-domain-defined-attributes' => array('optional' => true) + $BuiltInDomainDefinedAttributes, |
|
706 | - 'extension-attributes' => array('optional' => true) + $ExtensionAttributes |
|
704 | + 'built-in-standard-attributes' => $BuiltInStandardAttributes, |
|
705 | + 'built-in-domain-defined-attributes' => array('optional' => true) + $BuiltInDomainDefinedAttributes, |
|
706 | + 'extension-attributes' => array('optional' => true) + $ExtensionAttributes |
|
707 | 707 | ) |
708 | 708 | ); |
709 | 709 | |
710 | 710 | $EDIPartyName = array( |
711 | 711 | 'type' => FILE_ASN1_TYPE_SEQUENCE, |
712 | 712 | 'children' => array( |
713 | - 'nameAssigner' => array( |
|
713 | + 'nameAssigner' => array( |
|
714 | 714 | 'constant' => 0, |
715 | 715 | 'optional' => true, |
716 | 716 | 'implicit' => true |
717 | 717 | ) + $this->DirectoryString, |
718 | - // partyName is technically required but File_ASN1 doesn't currently support non-optional constants and |
|
719 | - // setting it to optional gets the job done in any event. |
|
720 | - 'partyName' => array( |
|
718 | + // partyName is technically required but File_ASN1 doesn't currently support non-optional constants and |
|
719 | + // setting it to optional gets the job done in any event. |
|
720 | + 'partyName' => array( |
|
721 | 721 | 'constant' => 1, |
722 | 722 | 'optional' => true, |
723 | 723 | 'implicit' => true |
@@ -729,55 +729,55 @@ discard block |
||
729 | 729 | 'type' => FILE_ASN1_TYPE_CHOICE, |
730 | 730 | 'children' => array( |
731 | 731 | 'otherName' => array( |
732 | - 'constant' => 0, |
|
733 | - 'optional' => true, |
|
734 | - 'implicit' => true |
|
735 | - ) + $AnotherName, |
|
732 | + 'constant' => 0, |
|
733 | + 'optional' => true, |
|
734 | + 'implicit' => true |
|
735 | + ) + $AnotherName, |
|
736 | 736 | 'rfc822Name' => array( |
737 | - 'type' => FILE_ASN1_TYPE_IA5_STRING, |
|
738 | - 'constant' => 1, |
|
739 | - 'optional' => true, |
|
740 | - 'implicit' => true |
|
741 | - ), |
|
737 | + 'type' => FILE_ASN1_TYPE_IA5_STRING, |
|
738 | + 'constant' => 1, |
|
739 | + 'optional' => true, |
|
740 | + 'implicit' => true |
|
741 | + ), |
|
742 | 742 | 'dNSName' => array( |
743 | - 'type' => FILE_ASN1_TYPE_IA5_STRING, |
|
744 | - 'constant' => 2, |
|
745 | - 'optional' => true, |
|
746 | - 'implicit' => true |
|
747 | - ), |
|
743 | + 'type' => FILE_ASN1_TYPE_IA5_STRING, |
|
744 | + 'constant' => 2, |
|
745 | + 'optional' => true, |
|
746 | + 'implicit' => true |
|
747 | + ), |
|
748 | 748 | 'x400Address' => array( |
749 | - 'constant' => 3, |
|
750 | - 'optional' => true, |
|
751 | - 'implicit' => true |
|
752 | - ) + $ORAddress, |
|
749 | + 'constant' => 3, |
|
750 | + 'optional' => true, |
|
751 | + 'implicit' => true |
|
752 | + ) + $ORAddress, |
|
753 | 753 | 'directoryName' => array( |
754 | - 'constant' => 4, |
|
755 | - 'optional' => true, |
|
756 | - 'explicit' => true |
|
757 | - ) + $this->Name, |
|
754 | + 'constant' => 4, |
|
755 | + 'optional' => true, |
|
756 | + 'explicit' => true |
|
757 | + ) + $this->Name, |
|
758 | 758 | 'ediPartyName' => array( |
759 | - 'constant' => 5, |
|
760 | - 'optional' => true, |
|
761 | - 'implicit' => true |
|
762 | - ) + $EDIPartyName, |
|
759 | + 'constant' => 5, |
|
760 | + 'optional' => true, |
|
761 | + 'implicit' => true |
|
762 | + ) + $EDIPartyName, |
|
763 | 763 | 'uniformResourceIdentifier' => array( |
764 | - 'type' => FILE_ASN1_TYPE_IA5_STRING, |
|
765 | - 'constant' => 6, |
|
766 | - 'optional' => true, |
|
767 | - 'implicit' => true |
|
768 | - ), |
|
764 | + 'type' => FILE_ASN1_TYPE_IA5_STRING, |
|
765 | + 'constant' => 6, |
|
766 | + 'optional' => true, |
|
767 | + 'implicit' => true |
|
768 | + ), |
|
769 | 769 | 'iPAddress' => array( |
770 | - 'type' => FILE_ASN1_TYPE_OCTET_STRING, |
|
771 | - 'constant' => 7, |
|
772 | - 'optional' => true, |
|
773 | - 'implicit' => true |
|
774 | - ), |
|
770 | + 'type' => FILE_ASN1_TYPE_OCTET_STRING, |
|
771 | + 'constant' => 7, |
|
772 | + 'optional' => true, |
|
773 | + 'implicit' => true |
|
774 | + ), |
|
775 | 775 | 'registeredID' => array( |
776 | - 'type' => FILE_ASN1_TYPE_OBJECT_IDENTIFIER, |
|
777 | - 'constant' => 8, |
|
778 | - 'optional' => true, |
|
779 | - 'implicit' => true |
|
780 | - ) |
|
776 | + 'type' => FILE_ASN1_TYPE_OBJECT_IDENTIFIER, |
|
777 | + 'constant' => 8, |
|
778 | + 'optional' => true, |
|
779 | + 'implicit' => true |
|
780 | + ) |
|
781 | 781 | ) |
782 | 782 | ); |
783 | 783 | |
@@ -809,15 +809,15 @@ discard block |
||
809 | 809 | 'type' => FILE_ASN1_TYPE_CHOICE, |
810 | 810 | 'children' => array( |
811 | 811 | 'fullName' => array( |
812 | - 'constant' => 0, |
|
813 | - 'optional' => true, |
|
814 | - 'implicit' => true |
|
815 | - ) + $GeneralNames, |
|
812 | + 'constant' => 0, |
|
813 | + 'optional' => true, |
|
814 | + 'implicit' => true |
|
815 | + ) + $GeneralNames, |
|
816 | 816 | 'nameRelativeToCRLIssuer' => array( |
817 | - 'constant' => 1, |
|
818 | - 'optional' => true, |
|
819 | - 'implicit' => true |
|
820 | - ) + $this->RelativeDistinguishedName |
|
817 | + 'constant' => 1, |
|
818 | + 'optional' => true, |
|
819 | + 'implicit' => true |
|
820 | + ) + $this->RelativeDistinguishedName |
|
821 | 821 | ) |
822 | 822 | ); |
823 | 823 | |
@@ -825,20 +825,20 @@ discard block |
||
825 | 825 | 'type' => FILE_ASN1_TYPE_SEQUENCE, |
826 | 826 | 'children' => array( |
827 | 827 | 'distributionPoint' => array( |
828 | - 'constant' => 0, |
|
829 | - 'optional' => true, |
|
830 | - 'explicit' => true |
|
831 | - ) + $DistributionPointName, |
|
828 | + 'constant' => 0, |
|
829 | + 'optional' => true, |
|
830 | + 'explicit' => true |
|
831 | + ) + $DistributionPointName, |
|
832 | 832 | 'reasons' => array( |
833 | - 'constant' => 1, |
|
834 | - 'optional' => true, |
|
835 | - 'implicit' => true |
|
836 | - ) + $ReasonFlags, |
|
833 | + 'constant' => 1, |
|
834 | + 'optional' => true, |
|
835 | + 'implicit' => true |
|
836 | + ) + $ReasonFlags, |
|
837 | 837 | 'cRLIssuer' => array( |
838 | - 'constant' => 2, |
|
839 | - 'optional' => true, |
|
840 | - 'implicit' => true |
|
841 | - ) + $GeneralNames |
|
838 | + 'constant' => 2, |
|
839 | + 'optional' => true, |
|
840 | + 'implicit' => true |
|
841 | + ) + $GeneralNames |
|
842 | 842 | ) |
843 | 843 | ); |
844 | 844 | |
@@ -853,20 +853,20 @@ discard block |
||
853 | 853 | 'type' => FILE_ASN1_TYPE_SEQUENCE, |
854 | 854 | 'children' => array( |
855 | 855 | 'keyIdentifier' => array( |
856 | - 'constant' => 0, |
|
857 | - 'optional' => true, |
|
858 | - 'implicit' => true |
|
859 | - ) + $this->KeyIdentifier, |
|
856 | + 'constant' => 0, |
|
857 | + 'optional' => true, |
|
858 | + 'implicit' => true |
|
859 | + ) + $this->KeyIdentifier, |
|
860 | 860 | 'authorityCertIssuer' => array( |
861 | - 'constant' => 1, |
|
862 | - 'optional' => true, |
|
863 | - 'implicit' => true |
|
864 | - ) + $GeneralNames, |
|
861 | + 'constant' => 1, |
|
862 | + 'optional' => true, |
|
863 | + 'implicit' => true |
|
864 | + ) + $GeneralNames, |
|
865 | 865 | 'authorityCertSerialNumber' => array( |
866 | - 'constant' => 2, |
|
867 | - 'optional' => true, |
|
868 | - 'implicit' => true |
|
869 | - ) + $CertificateSerialNumber |
|
866 | + 'constant' => 2, |
|
867 | + 'optional' => true, |
|
868 | + 'implicit' => true |
|
869 | + ) + $CertificateSerialNumber |
|
870 | 870 | ) |
871 | 871 | ); |
872 | 872 | |
@@ -887,12 +887,12 @@ discard block |
||
887 | 887 | 'children' => array( |
888 | 888 | 'policyIdentifier' => $CertPolicyId, |
889 | 889 | 'policyQualifiers' => array( |
890 | - 'type' => FILE_ASN1_TYPE_SEQUENCE, |
|
891 | - 'min' => 0, |
|
892 | - 'max' => -1, |
|
893 | - 'optional' => true, |
|
894 | - 'children' => $PolicyQualifierInfo |
|
895 | - ) |
|
890 | + 'type' => FILE_ASN1_TYPE_SEQUENCE, |
|
891 | + 'min' => 0, |
|
892 | + 'max' => -1, |
|
893 | + 'optional' => true, |
|
894 | + 'children' => $PolicyQualifierInfo |
|
895 | + ) |
|
896 | 896 | ) |
897 | 897 | ); |
898 | 898 | |
@@ -908,12 +908,12 @@ discard block |
||
908 | 908 | 'min' => 1, |
909 | 909 | 'max' => -1, |
910 | 910 | 'children' => array( |
911 | - 'type' => FILE_ASN1_TYPE_SEQUENCE, |
|
912 | - 'children' => array( |
|
913 | - 'issuerDomainPolicy' => $CertPolicyId, |
|
914 | - 'subjectDomainPolicy' => $CertPolicyId |
|
915 | - ) |
|
916 | - ) |
|
911 | + 'type' => FILE_ASN1_TYPE_SEQUENCE, |
|
912 | + 'children' => array( |
|
913 | + 'issuerDomainPolicy' => $CertPolicyId, |
|
914 | + 'subjectDomainPolicy' => $CertPolicyId |
|
915 | + ) |
|
916 | + ) |
|
917 | 917 | ); |
918 | 918 | |
919 | 919 | $KeyPurposeId = array('type' => FILE_ASN1_TYPE_OBJECT_IDENTIFIER); |
@@ -946,15 +946,15 @@ discard block |
||
946 | 946 | 'type' => FILE_ASN1_TYPE_SEQUENCE, |
947 | 947 | 'children' => array( |
948 | 948 | 'notBefore' => array( |
949 | - 'constant' => 0, |
|
950 | - 'optional' => true, |
|
951 | - 'implicit' => true, |
|
952 | - 'type' => FILE_ASN1_TYPE_GENERALIZED_TIME), |
|
949 | + 'constant' => 0, |
|
950 | + 'optional' => true, |
|
951 | + 'implicit' => true, |
|
952 | + 'type' => FILE_ASN1_TYPE_GENERALIZED_TIME), |
|
953 | 953 | 'notAfter' => array( |
954 | - 'constant' => 1, |
|
955 | - 'optional' => true, |
|
956 | - 'implicit' => true, |
|
957 | - 'type' => FILE_ASN1_TYPE_GENERALIZED_TIME) |
|
954 | + 'constant' => 1, |
|
955 | + 'optional' => true, |
|
956 | + 'implicit' => true, |
|
957 | + 'type' => FILE_ASN1_TYPE_GENERALIZED_TIME) |
|
958 | 958 | ) |
959 | 959 | ); |
960 | 960 | |
@@ -965,16 +965,16 @@ discard block |
||
965 | 965 | 'children' => array( |
966 | 966 | 'base' => $GeneralName, |
967 | 967 | 'minimum' => array( |
968 | - 'constant' => 0, |
|
969 | - 'optional' => true, |
|
970 | - 'implicit' => true, |
|
971 | - 'default' => new Math_BigInteger(0) |
|
972 | - ) + $BaseDistance, |
|
968 | + 'constant' => 0, |
|
969 | + 'optional' => true, |
|
970 | + 'implicit' => true, |
|
971 | + 'default' => new Math_BigInteger(0) |
|
972 | + ) + $BaseDistance, |
|
973 | 973 | 'maximum' => array( |
974 | - 'constant' => 1, |
|
975 | - 'optional' => true, |
|
976 | - 'implicit' => true, |
|
977 | - ) + $BaseDistance |
|
974 | + 'constant' => 1, |
|
975 | + 'optional' => true, |
|
976 | + 'implicit' => true, |
|
977 | + ) + $BaseDistance |
|
978 | 978 | ) |
979 | 979 | ); |
980 | 980 | |
@@ -989,15 +989,15 @@ discard block |
||
989 | 989 | 'type' => FILE_ASN1_TYPE_SEQUENCE, |
990 | 990 | 'children' => array( |
991 | 991 | 'permittedSubtrees' => array( |
992 | - 'constant' => 0, |
|
993 | - 'optional' => true, |
|
994 | - 'implicit' => true |
|
995 | - ) + $GeneralSubtrees, |
|
992 | + 'constant' => 0, |
|
993 | + 'optional' => true, |
|
994 | + 'implicit' => true |
|
995 | + ) + $GeneralSubtrees, |
|
996 | 996 | 'excludedSubtrees' => array( |
997 | - 'constant' => 1, |
|
998 | - 'optional' => true, |
|
999 | - 'implicit' => true |
|
1000 | - ) + $GeneralSubtrees |
|
997 | + 'constant' => 1, |
|
998 | + 'optional' => true, |
|
999 | + 'implicit' => true |
|
1000 | + ) + $GeneralSubtrees |
|
1001 | 1001 | ) |
1002 | 1002 | ); |
1003 | 1003 | |
@@ -1018,11 +1018,11 @@ discard block |
||
1018 | 1018 | 'children' => array( |
1019 | 1019 | 'organization' => $DisplayText, |
1020 | 1020 | 'noticeNumbers' => array( |
1021 | - 'type' => FILE_ASN1_TYPE_SEQUENCE, |
|
1022 | - 'min' => 1, |
|
1023 | - 'max' => 200, |
|
1024 | - 'children' => array('type' => FILE_ASN1_TYPE_INTEGER) |
|
1025 | - ) |
|
1021 | + 'type' => FILE_ASN1_TYPE_SEQUENCE, |
|
1022 | + 'min' => 1, |
|
1023 | + 'max' => 200, |
|
1024 | + 'children' => array('type' => FILE_ASN1_TYPE_INTEGER) |
|
1025 | + ) |
|
1026 | 1026 | ) |
1027 | 1027 | ); |
1028 | 1028 | |
@@ -1030,13 +1030,13 @@ discard block |
||
1030 | 1030 | 'type' => FILE_ASN1_TYPE_SEQUENCE, |
1031 | 1031 | 'children' => array( |
1032 | 1032 | 'noticeRef' => array( |
1033 | - 'optional' => true, |
|
1034 | - 'implicit' => true |
|
1035 | - ) + $NoticeReference, |
|
1033 | + 'optional' => true, |
|
1034 | + 'implicit' => true |
|
1035 | + ) + $NoticeReference, |
|
1036 | 1036 | 'explicitText' => array( |
1037 | - 'optional' => true, |
|
1038 | - 'implicit' => true |
|
1039 | - ) + $DisplayText |
|
1037 | + 'optional' => true, |
|
1038 | + 'implicit' => true |
|
1039 | + ) + $DisplayText |
|
1040 | 1040 | ) |
1041 | 1041 | ); |
1042 | 1042 | |
@@ -1065,11 +1065,11 @@ discard block |
||
1065 | 1065 | 'children' => array( |
1066 | 1066 | 'type' => $AttributeType, |
1067 | 1067 | 'value'=> array( |
1068 | - 'type' => FILE_ASN1_TYPE_SET, |
|
1069 | - 'min' => 1, |
|
1070 | - 'max' => -1, |
|
1071 | - 'children' => $this->AttributeValue |
|
1072 | - ) |
|
1068 | + 'type' => FILE_ASN1_TYPE_SET, |
|
1069 | + 'min' => 1, |
|
1070 | + 'max' => -1, |
|
1071 | + 'children' => $this->AttributeValue |
|
1072 | + ) |
|
1073 | 1073 | ) |
1074 | 1074 | ); |
1075 | 1075 | |
@@ -1086,16 +1086,16 @@ discard block |
||
1086 | 1086 | 'type' => FILE_ASN1_TYPE_SEQUENCE, |
1087 | 1087 | 'children' => array( |
1088 | 1088 | 'version' => array( |
1089 | - 'type' => FILE_ASN1_TYPE_INTEGER, |
|
1090 | - 'mapping' => array('v1') |
|
1091 | - ), |
|
1089 | + 'type' => FILE_ASN1_TYPE_INTEGER, |
|
1090 | + 'mapping' => array('v1') |
|
1091 | + ), |
|
1092 | 1092 | 'subject' => $this->Name, |
1093 | 1093 | 'subjectPKInfo' => $SubjectPublicKeyInfo, |
1094 | 1094 | 'attributes' => array( |
1095 | - 'constant' => 0, |
|
1096 | - 'optional' => true, |
|
1097 | - 'implicit' => true |
|
1098 | - ) + $Attributes, |
|
1095 | + 'constant' => 0, |
|
1096 | + 'optional' => true, |
|
1097 | + 'implicit' => true |
|
1098 | + ) + $Attributes, |
|
1099 | 1099 | ) |
1100 | 1100 | ); |
1101 | 1101 | |
@@ -1111,39 +1111,39 @@ discard block |
||
1111 | 1111 | $RevokedCertificate = array( |
1112 | 1112 | 'type' => FILE_ASN1_TYPE_SEQUENCE, |
1113 | 1113 | 'children' => array( |
1114 | - 'userCertificate' => $CertificateSerialNumber, |
|
1115 | - 'revocationDate' => $Time, |
|
1116 | - 'crlEntryExtensions' => array( |
|
1117 | - 'optional' => true |
|
1118 | - ) + $this->Extensions |
|
1119 | - ) |
|
1114 | + 'userCertificate' => $CertificateSerialNumber, |
|
1115 | + 'revocationDate' => $Time, |
|
1116 | + 'crlEntryExtensions' => array( |
|
1117 | + 'optional' => true |
|
1118 | + ) + $this->Extensions |
|
1119 | + ) |
|
1120 | 1120 | ); |
1121 | 1121 | |
1122 | 1122 | $TBSCertList = array( |
1123 | 1123 | 'type' => FILE_ASN1_TYPE_SEQUENCE, |
1124 | 1124 | 'children' => array( |
1125 | 1125 | 'version' => array( |
1126 | - 'optional' => true, |
|
1127 | - 'default' => 'v1' |
|
1128 | - ) + $Version, |
|
1126 | + 'optional' => true, |
|
1127 | + 'default' => 'v1' |
|
1128 | + ) + $Version, |
|
1129 | 1129 | 'signature' => $AlgorithmIdentifier, |
1130 | 1130 | 'issuer' => $this->Name, |
1131 | 1131 | 'thisUpdate' => $Time, |
1132 | 1132 | 'nextUpdate' => array( |
1133 | - 'optional' => true |
|
1134 | - ) + $Time, |
|
1133 | + 'optional' => true |
|
1134 | + ) + $Time, |
|
1135 | 1135 | 'revokedCertificates' => array( |
1136 | - 'type' => FILE_ASN1_TYPE_SEQUENCE, |
|
1137 | - 'optional' => true, |
|
1138 | - 'min' => 0, |
|
1139 | - 'max' => -1, |
|
1140 | - 'children' => $RevokedCertificate |
|
1141 | - ), |
|
1136 | + 'type' => FILE_ASN1_TYPE_SEQUENCE, |
|
1137 | + 'optional' => true, |
|
1138 | + 'min' => 0, |
|
1139 | + 'max' => -1, |
|
1140 | + 'children' => $RevokedCertificate |
|
1141 | + ), |
|
1142 | 1142 | 'crlExtensions' => array( |
1143 | - 'constant' => 0, |
|
1144 | - 'optional' => true, |
|
1145 | - 'explicit' => true |
|
1146 | - ) + $this->Extensions |
|
1143 | + 'constant' => 0, |
|
1144 | + 'optional' => true, |
|
1145 | + 'explicit' => true |
|
1146 | + ) + $this->Extensions |
|
1147 | 1147 | ) |
1148 | 1148 | ); |
1149 | 1149 | |
@@ -1159,7 +1159,7 @@ discard block |
||
1159 | 1159 | $this->CRLNumber = array('type' => FILE_ASN1_TYPE_INTEGER); |
1160 | 1160 | |
1161 | 1161 | $this->CRLReason = array('type' => FILE_ASN1_TYPE_ENUMERATED, |
1162 | - 'mapping' => array( |
|
1162 | + 'mapping' => array( |
|
1163 | 1163 | 'unspecified', |
1164 | 1164 | 'keyCompromise', |
1165 | 1165 | 'cACompromise', |
@@ -1214,7 +1214,7 @@ discard block |
||
1214 | 1214 | 'default' => false, |
1215 | 1215 | 'implicit' => true |
1216 | 1216 | ) |
1217 | - ) |
|
1217 | + ) |
|
1218 | 1218 | ); |
1219 | 1219 | |
1220 | 1220 | $this->InvalidityDate = array('type' => FILE_ASN1_TYPE_GENERALIZED_TIME); |
@@ -4132,7 +4132,7 @@ discard block |
||
4132 | 4132 | |
4133 | 4133 | $i = count($rclist); |
4134 | 4134 | $rclist[] = array('userCertificate' => $serial, |
4135 | - 'revocationDate' => array('generalTime' => @date('D, d M y H:i:s O'))); |
|
4135 | + 'revocationDate' => array('generalTime' => @date('D, d M y H:i:s O'))); |
|
4136 | 4136 | return $i; |
4137 | 4137 | } |
4138 | 4138 |
@@ -1662,8 +1662,8 @@ discard block |
||
1662 | 1662 | ); |
1663 | 1663 | |
1664 | 1664 | $RSAPublicKey = "-----BEGIN PUBLIC KEY-----\r\n" . |
1665 | - chunk_split(base64_encode($encapsulated)) . |
|
1666 | - '-----END PUBLIC KEY-----'; |
|
1665 | + chunk_split(base64_encode($encapsulated)) . |
|
1666 | + '-----END PUBLIC KEY-----'; |
|
1667 | 1667 | |
1668 | 1668 | $plaintext = str_pad($this->toBytes(), strlen($n->toBytes(true)) - 1, "\0", STR_PAD_LEFT); |
1669 | 1669 | |
@@ -3245,7 +3245,7 @@ discard block |
||
3245 | 3245 | |
3246 | 3246 | if (!$t) { |
3247 | 3247 | // see HAC 4.49 "Note (controlling the error probability)" |
3248 | - if ($length >= 163) { $t = 2; } // floor(1300 / 8) |
|
3248 | + if ($length >= 163) { $t = 2; } // floor(1300 / 8) |
|
3249 | 3249 | else if ($length >= 106) { $t = 3; } // floor( 850 / 8) |
3250 | 3250 | else if ($length >= 81 ) { $t = 4; } // floor( 650 / 8) |
3251 | 3251 | else if ($length >= 68 ) { $t = 5; } // floor( 550 / 8) |
@@ -822,7 +822,7 @@ discard block |
||
822 | 822 | array(60 => 'NET_SSH2_MSG_USERAUTH_PASSWD_CHANGEREQ'), |
823 | 823 | array(60 => 'NET_SSH2_MSG_USERAUTH_PK_OK'), |
824 | 824 | array(60 => 'NET_SSH2_MSG_USERAUTH_INFO_REQUEST', |
825 | - 61 => 'NET_SSH2_MSG_USERAUTH_INFO_RESPONSE') |
|
825 | + 61 => 'NET_SSH2_MSG_USERAUTH_INFO_RESPONSE') |
|
826 | 826 | ); |
827 | 827 | |
828 | 828 | $start = strtok(microtime(), ' ') + strtok(''); // http://php.net/microtime#61838 |
@@ -970,7 +970,7 @@ discard block |
||
970 | 970 | 'twofish192-cbc', // OPTIONAL Twofish with a 192-bit key |
971 | 971 | 'twofish256-cbc', |
972 | 972 | 'twofish-cbc', // OPTIONAL alias for "twofish256-cbc" |
973 | - // (this is being retained for historical reasons) |
|
973 | + // (this is being retained for historical reasons) |
|
974 | 974 | '3des-ctr', // RECOMMENDED Three-key 3DES in SDCTR mode |
975 | 975 | |
976 | 976 | '3des-cbc', // REQUIRED three-key 3DES in CBC mode |
@@ -1000,8 +1000,8 @@ discard block |
||
1000 | 1000 | } |
1001 | 1001 | |
1002 | 1002 | static $str_kex_algorithms, $str_server_host_key_algorithms, |
1003 | - $encryption_algorithms_server_to_client, $mac_algorithms_server_to_client, $compression_algorithms_server_to_client, |
|
1004 | - $encryption_algorithms_client_to_server, $mac_algorithms_client_to_server, $compression_algorithms_client_to_server; |
|
1003 | + $encryption_algorithms_server_to_client, $mac_algorithms_server_to_client, $compression_algorithms_server_to_client, |
|
1004 | + $encryption_algorithms_client_to_server, $mac_algorithms_client_to_server, $compression_algorithms_client_to_server; |
|
1005 | 1005 | |
1006 | 1006 | if (empty($str_kex_algorithms)) { |
1007 | 1007 | $str_kex_algorithms = implode(',', $kex_algorithms); |
@@ -1171,20 +1171,20 @@ discard block |
||
1171 | 1171 | // http://tools.ietf.org/html/rfc2412, appendex E |
1172 | 1172 | case 'diffie-hellman-group1-sha1': |
1173 | 1173 | $prime = 'FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74' . |
1174 | - '020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F1437' . |
|
1175 | - '4FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7ED' . |
|
1176 | - 'EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE65381FFFFFFFFFFFFFFFF'; |
|
1174 | + '020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F1437' . |
|
1175 | + '4FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7ED' . |
|
1176 | + 'EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE65381FFFFFFFFFFFFFFFF'; |
|
1177 | 1177 | break; |
1178 | 1178 | // see http://tools.ietf.org/html/rfc3526#section-3 |
1179 | 1179 | case 'diffie-hellman-group14-sha1': |
1180 | 1180 | $prime = 'FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74' . |
1181 | - '020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F1437' . |
|
1182 | - '4FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7ED' . |
|
1183 | - 'EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3DC2007CB8A163BF05' . |
|
1184 | - '98DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB' . |
|
1185 | - '9ED529077096966D670C354E4ABC9804F1746C08CA18217C32905E462E36CE3B' . |
|
1186 | - 'E39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF695581718' . |
|
1187 | - '3995497CEA956AE515D2261898FA051015728E5A8AACAA68FFFFFFFFFFFFFFFF'; |
|
1181 | + '020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F1437' . |
|
1182 | + '4FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7ED' . |
|
1183 | + 'EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3DC2007CB8A163BF05' . |
|
1184 | + '98DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB' . |
|
1185 | + '9ED529077096966D670C354E4ABC9804F1746C08CA18217C32905E462E36CE3B' . |
|
1186 | + 'E39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF695581718' . |
|
1187 | + '3995497CEA956AE515D2261898FA051015728E5A8AACAA68FFFFFFFFFFFFFFFF'; |
|
1188 | 1188 | break; |
1189 | 1189 | } |
1190 | 1190 | |
@@ -2413,7 +2413,7 @@ discard block |
||
2413 | 2413 | $current = strtok(microtime(), ' ') + strtok(''); |
2414 | 2414 | $message_number = isset($this->message_numbers[ord($payload[0])]) ? $this->message_numbers[ord($payload[0])] : 'UNKNOWN (' . ord($payload[0]) . ')'; |
2415 | 2415 | $message_number = '<- ' . $message_number . |
2416 | - ' (since last: ' . round($current - $this->last_packet, 4) . ', network: ' . round($stop - $start, 4) . 's)'; |
|
2416 | + ' (since last: ' . round($current - $this->last_packet, 4) . ', network: ' . round($stop - $start, 4) . 's)'; |
|
2417 | 2417 | $this->_append_log($message_number, $payload); |
2418 | 2418 | $this->last_packet = $current; |
2419 | 2419 | } |
@@ -2782,7 +2782,7 @@ discard block |
||
2782 | 2782 | $current = strtok(microtime(), ' ') + strtok(''); |
2783 | 2783 | $message_number = isset($this->message_numbers[ord($data[0])]) ? $this->message_numbers[ord($data[0])] : 'UNKNOWN (' . ord($data[0]) . ')'; |
2784 | 2784 | $message_number = '-> ' . $message_number . |
2785 | - ' (since last: ' . round($current - $this->last_packet, 4) . ', network: ' . round($stop - $start, 4) . 's)'; |
|
2785 | + ' (since last: ' . round($current - $this->last_packet, 4) . ', network: ' . round($stop - $start, 4) . 's)'; |
|
2786 | 2786 | $this->_append_log($message_number, $data); |
2787 | 2787 | $this->last_packet = $current; |
2788 | 2788 | } |
@@ -3024,12 +3024,12 @@ discard block |
||
3024 | 3024 | } |
3025 | 3025 | $fragment = $this->_string_shift($current_log, $short_width); |
3026 | 3026 | $hex = substr( |
3027 | - preg_replace( |
|
3028 | - '#(.)#es', |
|
3029 | - '"' . $boundary . '" . str_pad(dechex(ord(substr("\\1", -1))), 2, "0", STR_PAD_LEFT)', |
|
3030 | - $fragment), |
|
3031 | - strlen($boundary) |
|
3032 | - ); |
|
3027 | + preg_replace( |
|
3028 | + '#(.)#es', |
|
3029 | + '"' . $boundary . '" . str_pad(dechex(ord(substr("\\1", -1))), 2, "0", STR_PAD_LEFT)', |
|
3030 | + $fragment), |
|
3031 | + strlen($boundary) |
|
3032 | + ); |
|
3033 | 3033 | // replace non ASCII printable characters with dots |
3034 | 3034 | // http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters |
3035 | 3035 | // also replace < with a . since < messes up the output on web browsers |
@@ -413,8 +413,8 @@ discard block |
||
413 | 413 | if ($response === false) { |
414 | 414 | // from PuTTY's psftp.exe |
415 | 415 | $command = "test -x /usr/lib/sftp-server && exec /usr/lib/sftp-server\n" . |
416 | - "test -x /usr/local/lib/sftp-server && exec /usr/local/lib/sftp-server\n" . |
|
417 | - "exec sftp-server"; |
|
416 | + "test -x /usr/local/lib/sftp-server && exec /usr/local/lib/sftp-server\n" . |
|
417 | + "exec sftp-server"; |
|
418 | 418 | // we don't do $this->exec($command, false) because exec() operates on a different channel and plus the SSH_MSG_CHANNEL_OPEN that exec() does |
419 | 419 | // is redundant |
420 | 420 | $packet = pack('CNNa*CNa*', |
@@ -2055,7 +2055,7 @@ discard block |
||
2055 | 2055 | |
2056 | 2056 | if (defined('NET_SFTP_LOGGING')) { |
2057 | 2057 | $packet_type = '-> ' . $this->packet_types[$type] . |
2058 | - ' (' . round($stop - $start, 4) . 's)'; |
|
2058 | + ' (' . round($stop - $start, 4) . 's)'; |
|
2059 | 2059 | if (NET_SFTP_LOGGING == NET_SFTP_LOG_REALTIME) { |
2060 | 2060 | echo "<pre>\r\n" . $this->_format_log(array($data), array($packet_type)) . "\r\n</pre>\r\n"; |
2061 | 2061 | flush(); |
@@ -2131,7 +2131,7 @@ discard block |
||
2131 | 2131 | |
2132 | 2132 | if (defined('NET_SFTP_LOGGING')) { |
2133 | 2133 | $packet_type = '<- ' . $this->packet_types[$this->packet_type] . |
2134 | - ' (' . round($stop - $start, 4) . 's)'; |
|
2134 | + ' (' . round($stop - $start, 4) . 's)'; |
|
2135 | 2135 | if (NET_SFTP_LOGGING == NET_SFTP_LOG_REALTIME) { |
2136 | 2136 | echo "<pre>\r\n" . $this->_format_log(array($packet), array($packet_type)) . "\r\n</pre>\r\n"; |
2137 | 2137 | flush(); |
@@ -1364,12 +1364,12 @@ |
||
1364 | 1364 | } |
1365 | 1365 | $fragment = $this->_string_shift($current_log, $short_width); |
1366 | 1366 | $hex = substr( |
1367 | - preg_replace( |
|
1368 | - '#(.)#es', |
|
1369 | - '"' . $boundary . '" . str_pad(dechex(ord(substr("\\1", -1))), 2, "0", STR_PAD_LEFT)', |
|
1370 | - $fragment), |
|
1371 | - strlen($boundary) |
|
1372 | - ); |
|
1367 | + preg_replace( |
|
1368 | + '#(.)#es', |
|
1369 | + '"' . $boundary . '" . str_pad(dechex(ord(substr("\\1", -1))), 2, "0", STR_PAD_LEFT)', |
|
1370 | + $fragment), |
|
1371 | + strlen($boundary) |
|
1372 | + ); |
|
1373 | 1373 | // replace non ASCII printable characters with dots |
1374 | 1374 | // http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters |
1375 | 1375 | // also replace < with a . since < messes up the output on web browsers |
@@ -18,7 +18,6 @@ discard block |
||
18 | 18 | * if (!$ssh->login('username', 'password')) { |
19 | 19 | * exit('bad login'); |
20 | 20 | * } |
21 | - |
|
22 | 21 | * $scp = new Net_SCP($ssh); |
23 | 22 | * $scp->put('abcd', str_repeat('x', 1024*1024)); |
24 | 23 | * ?> |
@@ -284,7 +283,7 @@ discard block |
||
284 | 283 | case NET_SCP_SSH1: |
285 | 284 | $data = pack('CNa*', NET_SSH1_CMSG_STDIN_DATA, strlen($data), $data); |
286 | 285 | $this->ssh->_send_binary_packet($data); |
287 | - } |
|
286 | + } |
|
288 | 287 | } |
289 | 288 | |
290 | 289 | /** |
@@ -320,7 +319,7 @@ discard block |
||
320 | 319 | return false; |
321 | 320 | } |
322 | 321 | } |
323 | - } |
|
322 | + } |
|
324 | 323 | } |
325 | 324 | |
326 | 325 | /** |
@@ -336,6 +335,6 @@ discard block |
||
336 | 335 | break; |
337 | 336 | case NET_SCP_SSH1: |
338 | 337 | $this->ssh->disconnect(); |
339 | - } |
|
338 | + } |
|
340 | 339 | } |
341 | 340 | } |
@@ -339,9 +339,9 @@ discard block |
||
339 | 339 | } |
340 | 340 | |
341 | 341 | /** |
342 | - * This function shows the content of a table in a grid. |
|
343 | - * Should not be use to edit information (edit/delete rows) only. |
|
344 | - **/ |
|
342 | + * This function shows the content of a table in a grid. |
|
343 | + * Should not be use to edit information (edit/delete rows) only. |
|
344 | + **/ |
|
345 | 345 | public function display_grid() |
346 | 346 | { |
347 | 347 | |
@@ -790,7 +790,7 @@ discard block |
||
790 | 790 | //$param[$tablename.'_direction'] = $_GET[$tablename.'_direction']; |
791 | 791 | $my_get_direction = $_GET[$tablename.'_direction']; |
792 | 792 | if (!in_array($my_get_direction, array('ASC', 'DESC'))) { |
793 | - $param[$tablename.'_direction'] = 'ASC'; |
|
793 | + $param[$tablename.'_direction'] = 'ASC'; |
|
794 | 794 | } else { |
795 | 795 | $param[$tablename.'_direction'] = $my_get_direction; |
796 | 796 | } |
@@ -917,7 +917,7 @@ discard block |
||
917 | 917 | if (is_array($row)) { |
918 | 918 | foreach ($row as & $value) { |
919 | 919 | if (empty($value)) { |
920 | - $value = '-'; |
|
920 | + $value = '-'; |
|
921 | 921 | } |
922 | 922 | } |
923 | 923 | } |
@@ -12,13 +12,13 @@ |
||
12 | 12 | switch ($_SESSION['whereami']) { |
13 | 13 | |
14 | 14 | |
15 | - case 'lp/build' : |
|
16 | - case 'document/create' : |
|
17 | - case 'document/edit' : |
|
18 | - $autostart = 'false'; |
|
19 | - break; |
|
20 | - default : |
|
21 | - $autostart = 'true'; |
|
15 | + case 'lp/build' : |
|
16 | + case 'document/create' : |
|
17 | + case 'document/edit' : |
|
18 | + $autostart = 'false'; |
|
19 | + break; |
|
20 | + default : |
|
21 | + $autostart = 'true'; |
|
22 | 22 | |
23 | 23 | } |
24 | 24 | echo utf8_encode('autostart='.$autostart); |
@@ -166,10 +166,10 @@ discard block |
||
166 | 166 | */ |
167 | 167 | function LoginDelete($user_id) |
168 | 168 | { |
169 | - $online_table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ONLINE); |
|
169 | + $online_table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ONLINE); |
|
170 | 170 | $user_id = intval($user_id); |
171 | - $query = "DELETE FROM " . $online_table . " WHERE login_user_id = $user_id"; |
|
172 | - Database::query($query); |
|
171 | + $query = "DELETE FROM " . $online_table . " WHERE login_user_id = $user_id"; |
|
172 | + Database::query($query); |
|
173 | 173 | } |
174 | 174 | |
175 | 175 | /** |
@@ -178,17 +178,17 @@ discard block |
||
178 | 178 | */ |
179 | 179 | function user_is_online($user_id) |
180 | 180 | { |
181 | - $track_online_table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ONLINE); |
|
182 | - $table_user = Database::get_main_table(TABLE_MAIN_USER); |
|
181 | + $track_online_table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ONLINE); |
|
182 | + $table_user = Database::get_main_table(TABLE_MAIN_USER); |
|
183 | 183 | |
184 | - $access_url_id = api_get_current_access_url_id(); |
|
185 | - $time_limit = api_get_setting('time_limit_whosonline'); |
|
184 | + $access_url_id = api_get_current_access_url_id(); |
|
185 | + $time_limit = api_get_setting('time_limit_whosonline'); |
|
186 | 186 | |
187 | 187 | $online_time = time() - $time_limit*60; |
188 | 188 | $limit_date = api_get_utc_datetime($online_time); |
189 | 189 | $user_id = intval($user_id); |
190 | 190 | |
191 | - $query = " SELECT login_user_id,login_date |
|
191 | + $query = " SELECT login_user_id,login_date |
|
192 | 192 | FROM $track_online_table track |
193 | 193 | INNER JOIN $table_user u ON (u.id=track.login_user_id) |
194 | 194 | WHERE |
@@ -197,13 +197,13 @@ discard block |
||
197 | 197 | u.id = $user_id |
198 | 198 | LIMIT 1 "; |
199 | 199 | |
200 | - $result = Database::query($query); |
|
201 | - if (Database::num_rows($result)) { |
|
200 | + $result = Database::query($query); |
|
201 | + if (Database::num_rows($result)) { |
|
202 | 202 | |
203 | - return true; |
|
204 | - } |
|
203 | + return true; |
|
204 | + } |
|
205 | 205 | |
206 | - return false; |
|
206 | + return false; |
|
207 | 207 | |
208 | 208 | } |
209 | 209 | /** |
@@ -239,13 +239,13 @@ discard block |
||
239 | 239 | |
240 | 240 | $online_time = time() - $time_limit * 60; |
241 | 241 | $current_date = api_get_utc_datetime($online_time); |
242 | - $track_online_table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ONLINE); |
|
243 | - $friend_user_table = Database::get_main_table(TABLE_MAIN_USER_REL_USER); |
|
244 | - $table_user = Database::get_main_table(TABLE_MAIN_USER); |
|
242 | + $track_online_table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ONLINE); |
|
243 | + $friend_user_table = Database::get_main_table(TABLE_MAIN_USER_REL_USER); |
|
244 | + $table_user = Database::get_main_table(TABLE_MAIN_USER); |
|
245 | 245 | |
246 | - if ($friends) { |
|
247 | - // who friends from social network is online |
|
248 | - $query = "SELECT DISTINCT login_user_id, login_date |
|
246 | + if ($friends) { |
|
247 | + // who friends from social network is online |
|
248 | + $query = "SELECT DISTINCT login_user_id, login_date |
|
249 | 249 | FROM $track_online_table INNER JOIN $friend_user_table |
250 | 250 | ON (friend_user_id = login_user_id) |
251 | 251 | WHERE |
@@ -255,21 +255,21 @@ discard block |
||
255 | 255 | user_id = '".api_get_user_id()."' |
256 | 256 | ORDER BY $column $direction |
257 | 257 | LIMIT $from, $number_of_items"; |
258 | - } else { |
|
259 | - $query = "SELECT DISTINCT login_user_id, login_date |
|
258 | + } else { |
|
259 | + $query = "SELECT DISTINCT login_user_id, login_date |
|
260 | 260 | FROM ".$track_online_table ." e |
261 | 261 | INNER JOIN ".$table_user ." u ON (u.id = e.login_user_id) |
262 | 262 | WHERE u.status != ".ANONYMOUS." AND login_date >= '".$current_date."' |
263 | 263 | ORDER BY $column $direction |
264 | 264 | LIMIT $from, $number_of_items"; |
265 | - } |
|
266 | - |
|
267 | - if (api_get_multiple_access_url()) { |
|
268 | - $access_url_id = api_get_current_access_url_id(); |
|
269 | - if ($access_url_id != -1) { |
|
270 | - if ($friends) { |
|
271 | - // friends from social network is online |
|
272 | - $query = "SELECT distinct login_user_id, login_date |
|
265 | + } |
|
266 | + |
|
267 | + if (api_get_multiple_access_url()) { |
|
268 | + $access_url_id = api_get_current_access_url_id(); |
|
269 | + if ($access_url_id != -1) { |
|
270 | + if ($friends) { |
|
271 | + // friends from social network is online |
|
272 | + $query = "SELECT distinct login_user_id, login_date |
|
273 | 273 | FROM $track_online_table track INNER JOIN $friend_user_table |
274 | 274 | ON (friend_user_id = login_user_id) |
275 | 275 | WHERE track.access_url_id = $access_url_id AND |
@@ -278,9 +278,9 @@ discard block |
||
278 | 278 | relation_type='".USER_RELATION_TYPE_FRIEND."' |
279 | 279 | ORDER BY $column $direction |
280 | 280 | LIMIT $from, $number_of_items"; |
281 | - } else { |
|
282 | - // all users online |
|
283 | - $query = "SELECT login_user_id, login_date |
|
281 | + } else { |
|
282 | + // all users online |
|
283 | + $query = "SELECT login_user_id, login_date |
|
284 | 284 | FROM ".$track_online_table ." track |
285 | 285 | INNER JOIN ".$table_user ." u |
286 | 286 | ON (u.id=track.login_user_id) |
@@ -288,26 +288,26 @@ discard block |
||
288 | 288 | login_date >= '".$current_date."' |
289 | 289 | ORDER BY $column $direction |
290 | 290 | LIMIT $from, $number_of_items"; |
291 | - } |
|
292 | - } |
|
293 | - } |
|
291 | + } |
|
292 | + } |
|
293 | + } |
|
294 | 294 | |
295 | - //This query will show all registered users. Only for dev purposes. |
|
296 | - /*$query = "SELECT DISTINCT u.id as login_user_id, login_date FROM ".$track_online_table ." e , $table_user u |
|
295 | + //This query will show all registered users. Only for dev purposes. |
|
296 | + /*$query = "SELECT DISTINCT u.id as login_user_id, login_date FROM ".$track_online_table ." e , $table_user u |
|
297 | 297 | GROUP by u.id |
298 | 298 | ORDER BY $column $direction |
299 | 299 | LIMIT $from, $number_of_items";*/ |
300 | 300 | |
301 | - $result = Database::query($query); |
|
302 | - if ($result) { |
|
303 | - $users_online = array(); |
|
304 | - while (list($login_user_id, $login_date) = Database::fetch_row($result)) { |
|
301 | + $result = Database::query($query); |
|
302 | + if ($result) { |
|
303 | + $users_online = array(); |
|
304 | + while (list($login_user_id, $login_date) = Database::fetch_row($result)) { |
|
305 | 305 | $users_online[] = $login_user_id; |
306 | - } |
|
307 | - return $users_online; |
|
308 | - } else { |
|
309 | - return false; |
|
310 | - } |
|
306 | + } |
|
307 | + return $users_online; |
|
308 | + } else { |
|
309 | + return false; |
|
310 | + } |
|
311 | 311 | } |
312 | 312 | |
313 | 313 | function who_is_online_count($time_limit = null, $friends = false) |
@@ -317,15 +317,15 @@ discard block |
||
317 | 317 | } else { |
318 | 318 | $time_limit = intval($time_limit); |
319 | 319 | } |
320 | - $track_online_table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ONLINE); |
|
321 | - $friend_user_table = Database::get_main_table(TABLE_MAIN_USER_REL_USER); |
|
322 | - $table_user = Database::get_main_table(TABLE_MAIN_USER); |
|
323 | - $online_time = time() - $time_limit * 60; |
|
324 | - $current_date = api_get_utc_datetime($online_time); |
|
325 | - |
|
326 | - if ($friends) { |
|
327 | - // who friends from social network is online |
|
328 | - $query = "SELECT DISTINCT count(login_user_id) as count |
|
320 | + $track_online_table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ONLINE); |
|
321 | + $friend_user_table = Database::get_main_table(TABLE_MAIN_USER_REL_USER); |
|
322 | + $table_user = Database::get_main_table(TABLE_MAIN_USER); |
|
323 | + $online_time = time() - $time_limit * 60; |
|
324 | + $current_date = api_get_utc_datetime($online_time); |
|
325 | + |
|
326 | + if ($friends) { |
|
327 | + // who friends from social network is online |
|
328 | + $query = "SELECT DISTINCT count(login_user_id) as count |
|
329 | 329 | FROM $track_online_table INNER JOIN $friend_user_table |
330 | 330 | ON (friend_user_id = login_user_id) |
331 | 331 | WHERE |
@@ -333,20 +333,20 @@ discard block |
||
333 | 333 | friend_user_id <> '".api_get_user_id()."' AND |
334 | 334 | relation_type='".USER_RELATION_TYPE_FRIEND."' AND |
335 | 335 | user_id = '".api_get_user_id()."' "; |
336 | - } else { |
|
337 | - // All users online |
|
338 | - $query = "SELECT count(login_id) as count |
|
336 | + } else { |
|
337 | + // All users online |
|
338 | + $query = "SELECT count(login_id) as count |
|
339 | 339 | FROM $track_online_table track INNER JOIN $table_user u |
340 | 340 | ON (u.id=track.login_user_id) |
341 | 341 | WHERE u.status != ".ANONYMOUS." AND login_date >= '$current_date' "; |
342 | - } |
|
343 | - |
|
344 | - if (api_get_multiple_access_url()) { |
|
345 | - $access_url_id = api_get_current_access_url_id(); |
|
346 | - if ($access_url_id != -1) { |
|
347 | - if ($friends) { |
|
348 | - // friends from social network is online |
|
349 | - $query = "SELECT DISTINCT count(login_user_id) as count |
|
342 | + } |
|
343 | + |
|
344 | + if (api_get_multiple_access_url()) { |
|
345 | + $access_url_id = api_get_current_access_url_id(); |
|
346 | + if ($access_url_id != -1) { |
|
347 | + if ($friends) { |
|
348 | + // friends from social network is online |
|
349 | + $query = "SELECT DISTINCT count(login_user_id) as count |
|
350 | 350 | FROM $track_online_table track |
351 | 351 | INNER JOIN $friend_user_table ON (friend_user_id = login_user_id) |
352 | 352 | WHERE |
@@ -354,29 +354,29 @@ discard block |
||
354 | 354 | login_date >= '".$current_date."' AND |
355 | 355 | friend_user_id <> '".api_get_user_id()."' AND |
356 | 356 | relation_type='".USER_RELATION_TYPE_FRIEND."' "; |
357 | - } else { |
|
358 | - // all users online |
|
359 | - $query = "SELECT count(login_id) as count FROM $track_online_table track |
|
357 | + } else { |
|
358 | + // all users online |
|
359 | + $query = "SELECT count(login_id) as count FROM $track_online_table track |
|
360 | 360 | INNER JOIN $table_user u ON (u.id=track.login_user_id) |
361 | 361 | WHERE |
362 | 362 | u.status != ".ANONYMOUS." AND |
363 | 363 | track.access_url_id = $access_url_id AND |
364 | 364 | login_date >= '$current_date' "; |
365 | - } |
|
366 | - } |
|
367 | - } |
|
365 | + } |
|
366 | + } |
|
367 | + } |
|
368 | 368 | |
369 | 369 | // Dev purposes show all users online |
370 | 370 | /*$table_user = Database::get_main_table(TABLE_MAIN_USER); |
371 | 371 | $query = "SELECT count(*) as count FROM ".$table_user;*/ |
372 | 372 | |
373 | - $result = Database::query($query); |
|
374 | - if (Database::num_rows($result) > 0) { |
|
375 | - $row = Database::fetch_array($result); |
|
376 | - return $row['count']; |
|
377 | - } else { |
|
378 | - return false; |
|
379 | - } |
|
373 | + $result = Database::query($query); |
|
374 | + if (Database::num_rows($result) > 0) { |
|
375 | + $row = Database::fetch_array($result); |
|
376 | + return $row['count']; |
|
377 | + } else { |
|
378 | + return false; |
|
379 | + } |
|
380 | 380 | } |
381 | 381 | |
382 | 382 | |
@@ -389,7 +389,7 @@ discard block |
||
389 | 389 | */ |
390 | 390 | function who_is_online_in_this_course($from, $number_of_items, $uid, $time_limit, $course_code) |
391 | 391 | { |
392 | - if (empty($course_code)) return false; |
|
392 | + if (empty($course_code)) return false; |
|
393 | 393 | |
394 | 394 | if (empty($time_limit)) { |
395 | 395 | $time_limit = api_get_setting('time_limit_whosonline'); |
@@ -401,56 +401,56 @@ discard block |
||
401 | 401 | $current_date = api_get_utc_datetime($online_time); |
402 | 402 | $track_online_table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ONLINE); |
403 | 403 | $course_code = Database::escape_string($course_code); |
404 | - $courseInfo = api_get_course_info($course_code); |
|
405 | - $courseId = $courseInfo['real_id']; |
|
404 | + $courseInfo = api_get_course_info($course_code); |
|
405 | + $courseId = $courseInfo['real_id']; |
|
406 | 406 | |
407 | 407 | $from = intval($from); |
408 | 408 | $number_of_items = intval($number_of_items); |
409 | 409 | |
410 | - $query = "SELECT login_user_id, login_date FROM $track_online_table |
|
410 | + $query = "SELECT login_user_id, login_date FROM $track_online_table |
|
411 | 411 | WHERE login_user_id <> 2 AND c_id = $courseId AND login_date >= '$current_date' |
412 | 412 | LIMIT $from, $number_of_items "; |
413 | 413 | |
414 | - $result = Database::query($query); |
|
415 | - if ($result) { |
|
416 | - $users_online = array(); |
|
414 | + $result = Database::query($query); |
|
415 | + if ($result) { |
|
416 | + $users_online = array(); |
|
417 | 417 | |
418 | - while(list($login_user_id, $login_date) = Database::fetch_row($result)) { |
|
418 | + while(list($login_user_id, $login_date) = Database::fetch_row($result)) { |
|
419 | 419 | $users_online[] = $login_user_id; |
420 | - } |
|
421 | - return $users_online; |
|
422 | - } else { |
|
423 | - return false; |
|
424 | - } |
|
420 | + } |
|
421 | + return $users_online; |
|
422 | + } else { |
|
423 | + return false; |
|
424 | + } |
|
425 | 425 | } |
426 | 426 | |
427 | 427 | function who_is_online_in_this_course_count($uid, $time_limit, $coursecode=null) |
428 | 428 | { |
429 | - if (empty($coursecode)) { |
|
430 | - return false; |
|
431 | - } |
|
432 | - $track_online_table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ONLINE); |
|
433 | - $coursecode = Database::escape_string($coursecode); |
|
434 | - $time_limit = Database::escape_string($time_limit); |
|
429 | + if (empty($coursecode)) { |
|
430 | + return false; |
|
431 | + } |
|
432 | + $track_online_table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ONLINE); |
|
433 | + $coursecode = Database::escape_string($coursecode); |
|
434 | + $time_limit = Database::escape_string($time_limit); |
|
435 | 435 | |
436 | 436 | $online_time = time() - $time_limit * 60; |
437 | 437 | $current_date = api_get_utc_datetime($online_time); |
438 | - $courseId = api_get_course_int_id($coursecode); |
|
438 | + $courseId = api_get_course_int_id($coursecode); |
|
439 | 439 | |
440 | - if (empty($courseId)) { |
|
441 | - return false; |
|
442 | - } |
|
440 | + if (empty($courseId)) { |
|
441 | + return false; |
|
442 | + } |
|
443 | 443 | |
444 | - $query = "SELECT count(login_user_id) as count |
|
444 | + $query = "SELECT count(login_user_id) as count |
|
445 | 445 | FROM $track_online_table |
446 | 446 | WHERE login_user_id <> 2 AND c_id = $courseId AND login_date >= '$current_date' "; |
447 | - $result = Database::query($query); |
|
448 | - if (Database::num_rows($result) > 0) { |
|
449 | - $row = Database::fetch_array($result); |
|
450 | - return $row['count']; |
|
451 | - } else { |
|
452 | - return false; |
|
453 | - } |
|
447 | + $result = Database::query($query); |
|
448 | + if (Database::num_rows($result) > 0) { |
|
449 | + $row = Database::fetch_array($result); |
|
450 | + return $row['count']; |
|
451 | + } else { |
|
452 | + return false; |
|
453 | + } |
|
454 | 454 | } |
455 | 455 | |
456 | 456 | /** |
@@ -460,17 +460,17 @@ discard block |
||
460 | 460 | * @deprecated user api_get_user_info($user_id) |
461 | 461 | */ |
462 | 462 | function GetFullUserName($uid) { |
463 | - $uid = (int) $uid; |
|
464 | - $uid = intval($uid); |
|
465 | - $user_table = Database::get_main_table(TABLE_MAIN_USER); |
|
466 | - $query = "SELECT firstname, lastname FROM ".$user_table." WHERE id=$uid"; |
|
467 | - $result = @Database::query($query); |
|
468 | - if (count($result)>0) { |
|
469 | - while(list($firstname,$lastname)= Database::fetch_array($result)) { |
|
470 | - $str = str_replace(' ', ' ', api_get_person_name($firstname, $lastname)); |
|
471 | - return $str; |
|
472 | - } |
|
473 | - } |
|
463 | + $uid = (int) $uid; |
|
464 | + $uid = intval($uid); |
|
465 | + $user_table = Database::get_main_table(TABLE_MAIN_USER); |
|
466 | + $query = "SELECT firstname, lastname FROM ".$user_table." WHERE id=$uid"; |
|
467 | + $result = @Database::query($query); |
|
468 | + if (count($result)>0) { |
|
469 | + while(list($firstname,$lastname)= Database::fetch_array($result)) { |
|
470 | + $str = str_replace(' ', ' ', api_get_person_name($firstname, $lastname)); |
|
471 | + return $str; |
|
472 | + } |
|
473 | + } |
|
474 | 474 | } |
475 | 475 | |
476 | 476 | /** |
@@ -482,44 +482,44 @@ discard block |
||
482 | 482 | $_cid = api_get_course_id(); |
483 | 483 | $_user = api_get_user_info(); |
484 | 484 | |
485 | - if (!$_user['user_id']) { |
|
486 | - return (false); |
|
487 | - } |
|
485 | + if (!$_user['user_id']) { |
|
486 | + return (false); |
|
487 | + } |
|
488 | 488 | $userId = intval($_user['user_id']); |
489 | - $track_user_table = Database::get_main_table(TABLE_MAIN_USER); |
|
490 | - $sql="SELECT chatcall_user_id, chatcall_date FROM $track_user_table |
|
489 | + $track_user_table = Database::get_main_table(TABLE_MAIN_USER); |
|
490 | + $sql="SELECT chatcall_user_id, chatcall_date FROM $track_user_table |
|
491 | 491 | WHERE ( id = $userId )"; |
492 | - $result=Database::query($sql); |
|
493 | - $row=Database::fetch_array($result); |
|
494 | - |
|
495 | - $login_date=$row['chatcall_date']; |
|
496 | - $hour = substr($login_date,11,2); |
|
497 | - $minute = substr($login_date,14,2); |
|
498 | - $second = substr($login_date,17,2); |
|
499 | - $month = substr($login_date,5,2); |
|
500 | - $day = substr($login_date,8,2); |
|
501 | - $year = substr($login_date,0,4); |
|
502 | - $calltime = mktime($hour,$minute,$second,$month,$day,$year); |
|
503 | - |
|
504 | - $time = api_get_utc_datetime(); |
|
505 | - $minute_passed=5; //within this limit, the chat call request is valid |
|
506 | - $limittime = mktime(date("H"),date("i")-$minute_passed,date("s"),date("m"),date("d"),date("Y")); |
|
507 | - |
|
508 | - if (($row['chatcall_user_id']) and ($calltime>$limittime)) { |
|
509 | - $webpath=api_get_path(WEB_CODE_PATH); |
|
510 | - $message=get_lang('YouWereCalled').' : '.GetFullUserName($row['chatcall_user_id'],'').'<br>'.get_lang('DoYouAccept') |
|
511 | - ."<p>" |
|
512 | - ."<a href=\"".$webpath."chat/chat.php?cidReq=".$_cid."&origin=whoisonlinejoin\">" |
|
513 | - . get_lang("Yes") |
|
514 | - ."</a>" |
|
515 | - ." | " |
|
516 | - ."<a href=\"".api_get_path(WEB_PATH)."webchatdeny.php\">" |
|
517 | - . get_lang("No") |
|
518 | - ."</a>" |
|
519 | - ."</p>"; |
|
520 | - |
|
521 | - return($message); |
|
522 | - } else { |
|
523 | - return false; |
|
524 | - } |
|
492 | + $result=Database::query($sql); |
|
493 | + $row=Database::fetch_array($result); |
|
494 | + |
|
495 | + $login_date=$row['chatcall_date']; |
|
496 | + $hour = substr($login_date,11,2); |
|
497 | + $minute = substr($login_date,14,2); |
|
498 | + $second = substr($login_date,17,2); |
|
499 | + $month = substr($login_date,5,2); |
|
500 | + $day = substr($login_date,8,2); |
|
501 | + $year = substr($login_date,0,4); |
|
502 | + $calltime = mktime($hour,$minute,$second,$month,$day,$year); |
|
503 | + |
|
504 | + $time = api_get_utc_datetime(); |
|
505 | + $minute_passed=5; //within this limit, the chat call request is valid |
|
506 | + $limittime = mktime(date("H"),date("i")-$minute_passed,date("s"),date("m"),date("d"),date("Y")); |
|
507 | + |
|
508 | + if (($row['chatcall_user_id']) and ($calltime>$limittime)) { |
|
509 | + $webpath=api_get_path(WEB_CODE_PATH); |
|
510 | + $message=get_lang('YouWereCalled').' : '.GetFullUserName($row['chatcall_user_id'],'').'<br>'.get_lang('DoYouAccept') |
|
511 | + ."<p>" |
|
512 | + ."<a href=\"".$webpath."chat/chat.php?cidReq=".$_cid."&origin=whoisonlinejoin\">" |
|
513 | + . get_lang("Yes") |
|
514 | + ."</a>" |
|
515 | + ." | " |
|
516 | + ."<a href=\"".api_get_path(WEB_PATH)."webchatdeny.php\">" |
|
517 | + . get_lang("No") |
|
518 | + ."</a>" |
|
519 | + ."</p>"; |
|
520 | + |
|
521 | + return($message); |
|
522 | + } else { |
|
523 | + return false; |
|
524 | + } |
|
525 | 525 | } |